Changes the shape of an edge without affecting the topology structure.
3190 lwerror(
"SQL/MM Spatial exception - curve not simple");
3199 "lwt_be_getEdgeById returned NULL and set i=%d", i);
3207 lwerror(
"SQL/MM Spatial exception - non-existent edge %"
3213 lwerror(
"Backend coding error: getEdgeById callback returned NULL "
3214 "but numelements output parameter has value %d "
3215 "(expected 0 or 1)", i);
3221 "old edge has %d points, new edge has %d points",
3232 lwerror(
"SQL/MM Spatial exception - "
3233 "start node not geometry start point.");
3244 " has less than 2 vertices", oldedge->
edge_id);
3251 lwerror(
"Invalid edge: less than 2 vertices");
3258 lwerror(
"SQL/MM Spatial exception - "
3259 "end node not geometry end point.");
3275 lwerror(
"Invalid edge (no two distinct vertices exist)");
3284 lwerror(
"Edge twist at node POINT(%g %g)", p1.
x, p1.
y);
3290 oldedge->
end_node, geom, edge_id ) )
3297 LWDEBUG(1,
"lwt_ChangeEdgeGeom: "
3298 "edge crossing check passed ");
3316 LWDEBUGF(1,
"lwt_be_getNodeWithinBox2D returned %d nodes", numnodes);
3317 if ( numnodes == -1 ) {
3323 if ( numnodes > ( 1 + isclosed ? 0 : 1 ) )
3326 for (i=0; i<numnodes; ++i)
3339 lwerror(
"Edge motion collision at %s", wkt);
3347 LWDEBUG(1,
"nodes containment check passed");
3357 oldedge->
geom, &p1, &p2);
3360 isclosed ? &epan_pre : NULL, edge_id );
3362 isclosed ? &span_pre : NULL, edge_id );
3372 newedge.
geom = geom;
3383 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
3398 isclosed ? &epan_post : NULL, edge_id );
3400 isclosed ? &span_post : NULL, edge_id );
3415 lwerror(
"Edge changed disposition around start node %"
3426 lwerror(
"Edge changed disposition around end node %"
3443 int facestoupdate = 0;
3452 lwerror(
"lwt_ChangeEdgeGeom could not construct face %"
3461 LWDEBUGF(1,
"new geometry of face left (%d): %s", (
int)oldedge->
face_left, wkt);
3466 if ( ! nface1->
bbox )
3468 lwerror(
"Corrupted topology: face %d, left of edge %d, has no bbox",
3474 faces[facestoupdate++].
mbr = nface1->
bbox;
3483 lwerror(
"lwt_ChangeEdgeGeom could not construct face %"
3497 if ( ! nface2->
bbox )
3499 lwerror(
"Corrupted topology: face %d, right of edge %d, has no bbox",
3504 faces[facestoupdate++].
mbr = nface2->
bbox;
3506 LWDEBUGF(1,
"%d faces to update", facestoupdate);
3507 if ( facestoupdate )
3510 if ( i != facestoupdate )
3518 lwerror(
"Unexpected error: %d faces found when expecting 1", i);
3525 lwnotice(
"BBOX of changed edge did not change");
3528 LWDEBUG(1,
"all done, cleaning up edges");
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
int gbox_union(const GBOX *g1, const GBOX *g2, GBOX *gout)
Update the output GBOX to be large enough to include both inputs.
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
void lwgeom_free(LWGEOM *geom)
int lwgeom_is_simple(const LWGEOM *lwgeom)
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number)
#define LW_INSIDE
Constants for point-in-polygon return values.
int ptarray_isccw(const POINTARRAY *pa)
int p2d_same(const POINT2D *p1, const POINT2D *p2)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_GEOM
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, int *numelems, int fields)
static int _lwt_InitEdgeEndByLine(edgeend *fee, edgeend *lee, LWLINE *edge, POINT2D *fp, POINT2D *lp)
static int _lwt_GetInteriorEdgePoint(const LWLINE *edge, POINT2D *ip)
LWGEOM * lwt_GetFaceGeometry(LWT_TOPOLOGY *topo, LWT_ELEMID faceid)
Return the geometry of a face.
static int lwt_be_updateFacesById(LWT_TOPOLOGY *topo, const LWT_ISO_FACE *faces, int numfaces)
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 LWT_ISO_NODE * lwt_be_getNodeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, int *numelems, int fields, int limit)
static int _lwt_FindAdjacentEdges(LWT_TOPOLOGY *topo, LWT_ELEMID node, edgeend *data, edgeend *other, int myedge_id)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
static int lwt_be_updateEdgesById(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
const LWT_BE_IFACE * be_iface