Changes the shape of an edge without affecting the topology structure.
3309 lwerror(
"SQL/MM Spatial exception - curve not simple");
3318 "lwt_be_getEdgeById returned NULL and set i=%d", i);
3326 lwerror(
"SQL/MM Spatial exception - non-existent edge %" 3332 lwerror(
"Backend coding error: getEdgeById callback returned NULL " 3333 "but numelements output parameter has value %d " 3334 "(expected 0 or 1)", i);
3340 "old edge has %d points, new edge has %d points",
3351 lwerror(
"SQL/MM Spatial exception - " 3352 "start node not geometry start point.");
3363 " has less than 2 vertices", oldedge->
edge_id);
3367 if ( geom->points->npoints < 2 )
3370 lwerror(
"Invalid edge: less than 2 vertices");
3373 getPoint2d_p(geom->points, geom->points->npoints-1, &pt);
3377 lwerror(
"SQL/MM Spatial exception - " 3378 "end node not geometry end point.");
3394 lwerror(
"Invalid edge (no two distinct vertices exist)");
3403 lwerror(
"Edge twist at node POINT(%g %g)", p1.
x, p1.
y);
3409 oldedge->
end_node, geom, edge_id ) )
3416 LWDEBUG(1,
"lwt_ChangeEdgeGeom: " 3417 "edge crossing check passed ");
3435 LWDEBUGF(1,
"lwt_be_getNodeWithinBox2D returned %d nodes", numnodes);
3436 if ( numnodes == -1 ) {
3442 if ( numnodes > ( 1 + isclosed ? 0 : 1 ) )
3444 GEOSGeometry *oarea, *narea;
3445 const GEOSPreparedGeometry *oareap, *nareap;
3453 lwerror(
"Could not compute edge motion area for old edge");
3460 GEOSGeom_destroy(oarea);
3462 lwerror(
"Could not compute edge motion area for new edge");
3467 oareap = GEOSPrepare( oarea );
3468 nareap = GEOSPrepare( narea );
3469 for (i=0; i<numnodes; ++i)
3479 ocont = GEOSPreparedContains( oareap, ngg );
3480 ncont = GEOSPreparedContains( nareap, ngg );
3481 GEOSGeom_destroy(ngg);
3482 if (ocont == 2 || ncont == 2)
3485 GEOSPreparedGeom_destroy(oareap);
3486 GEOSGeom_destroy(oarea);
3487 GEOSPreparedGeom_destroy(nareap);
3488 GEOSGeom_destroy(narea);
3494 GEOSPreparedGeom_destroy(oareap);
3495 GEOSGeom_destroy(oarea);
3496 GEOSPreparedGeom_destroy(nareap);
3497 GEOSGeom_destroy(narea);
3500 lwerror(
"Edge motion collision at %s", wkt);
3505 GEOSPreparedGeom_destroy(oareap);
3506 GEOSGeom_destroy(oarea);
3507 GEOSPreparedGeom_destroy(nareap);
3508 GEOSGeom_destroy(narea);
3512 LWDEBUG(1,
"nodes containment check passed");
3522 oldedge->
geom, &p1, &p2);
3525 isclosed ? &epan_pre : NULL, edge_id );
3527 isclosed ? &span_pre : NULL, edge_id );
3537 newedge.
geom = geom;
3548 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
3563 isclosed ? &epan_post : NULL, edge_id );
3565 isclosed ? &span_post : NULL, edge_id );
3580 lwerror(
"Edge changed disposition around start node %" 3591 lwerror(
"Edge changed disposition around end node %" 3604 int facestoupdate = 0;
3613 lwerror(
"lwt_ChangeEdgeGeom could not construct face %" 3622 LWDEBUGF(1,
"new geometry of face left (%d): %s", (
int)oldedge->
face_left, wkt);
3629 faces[facestoupdate++].
mbr = nface1->
bbox;
3638 lwerror(
"lwt_ChangeEdgeGeom could not construct face %" 3653 faces[facestoupdate++].
mbr = nface2->
bbox;
3655 LWDEBUGF(1,
"%d faces to update", facestoupdate);
3656 if ( facestoupdate )
3659 if ( i != facestoupdate )
3667 lwerror(
"Unexpected error: %d faces found when expecting 1", i);
3674 LWDEBUG(1,
"all done, cleaning up edges");
static int _lwt_CheckEdgeCrossing(LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, const LWLINE *geom, LWT_ELEMID myself)
static void _lwt_release_nodes(LWT_ISO_NODE *nodes, int num_nodes)
static int _lwt_GetInteriorEdgePoint(const LWLINE *edge, POINT2D *ip)
static int lwt_be_updateEdgesById(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
void lwgeom_free(LWGEOM *geom)
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
#define LWDEBUG(level, msg)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
int p2d_same(const POINT2D *p1, const POINT2D *p2)
int ptarray_isccw(const POINTARRAY *pa)
static int lwt_be_updateFacesById(LWT_TOPOLOGY *topo, const LWT_ISO_FACE *faces, int numfaces)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
void lwgeom_geos_error(const char *fmt,...)
const LWT_BE_IFACE * be_iface
static GEOSGeometry * _lwt_EdgeMotionArea(LWLINE *geom, int isclosed)
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, int autofix)
int gbox_union(const GBOX *g1, const GBOX *g2, GBOX *gout)
Update the output GBOX to be large enough to include both inputs.
static int _lwt_FindAdjacentEdges(LWT_TOPOLOGY *topo, LWT_ELEMID node, edgeend *data, edgeend *other, int myedge_id)
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID faceid)
Return the geometry of a face.
int lwgeom_is_simple(const LWGEOM *lwgeom)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_GEOM
static int _lwt_InitEdgeEndByLine(edgeend *fee, edgeend *lee, LWLINE *edge, POINT2D *fp, POINT2D *lp)
#define LWDEBUGF(level, msg,...)
static LWT_ISO_NODE * lwt_be_getNodeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, int *numelems, int fields, int limit)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.