Changes the shape of an edge without affecting the topology structure.
3252 lwerror(
"SQL/MM Spatial exception - curve not simple");
3261 "lwt_be_getEdgeById returned NULL and set i=%d", i);
3262 if (i == UINT64_MAX)
3269 lwerror(
"SQL/MM Spatial exception - non-existent edge %"
3275 lwerror(
"Backend coding error: getEdgeById callback returned NULL "
3276 "but numelements output parameter has value %d "
3277 "(expected 0 or 1)", i);
3283 "old edge has %d points, new edge has %d points",
3294 lwerror(
"SQL/MM Spatial exception - "
3295 "start node not geometry start point.");
3306 " has less than 2 vertices", oldedge->
edge_id);
3310 if ( geom->points->npoints < 2 )
3313 lwerror(
"Invalid edge: less than 2 vertices");
3316 getPoint2d_p(geom->points, geom->points->npoints-1, &pt);
3320 lwerror(
"SQL/MM Spatial exception - "
3321 "end node not geometry end point.");
3337 lwerror(
"Invalid edge (no two distinct vertices exist)");
3346 lwerror(
"Edge twist at node POINT(%g %g)", p1.
x, p1.
y);
3352 oldedge->
end_node, geom, edge_id ) )
3359 LWDEBUG(1,
"lwt_ChangeEdgeGeom: "
3360 "edge crossing check passed ");
3378 LWDEBUGF(1,
"lwt_be_getNodeWithinBox2D returned %d nodes", numnodes);
3379 if (numnodes == UINT64_MAX)
3386 if ( numnodes > ( 1 + isclosed ? 0 : 1 ) )
3389 for (i=0; i<numnodes; ++i)
3402 lwerror(
"Edge motion collision at %s", wkt);
3410 LWDEBUG(1,
"nodes containment check passed");
3423 isclosed ? &epan_pre : NULL, edge_id );
3425 isclosed ? &span_pre : NULL, edge_id );
3435 newedge.
geom = geom;
3446 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
3459 isclosed ? &epan_post : NULL, edge_id );
3461 isclosed ? &span_post : NULL, edge_id );
3476 lwerror(
"Edge changed disposition around start node %"
3487 lwerror(
"Edge changed disposition around end node %"
3504 uint64_t facestoupdate = 0;
3513 lwerror(
"lwt_ChangeEdgeGeom could not construct face %"
3522 LWDEBUGF(1,
"new geometry of face left (%d): %s", (
int)oldedge->
face_left, wkt);
3527 if ( ! nface1->
bbox )
3529 lwerror(
"Corrupted topology: face %d, left of edge %d, has no bbox",
3535 faces[facestoupdate++].
mbr = nface1->
bbox;
3544 lwerror(
"lwt_ChangeEdgeGeom could not construct face %"
3558 if ( ! nface2->
bbox )
3560 lwerror(
"Corrupted topology: face %d, right of edge %d, has no bbox",
3565 faces[facestoupdate++].
mbr = nface2->
bbox;
3567 LWDEBUGF(1,
"%d faces to update", facestoupdate);
3568 if ( facestoupdate )
3571 if (updatedFaces != facestoupdate)
3578 if (updatedFaces == UINT64_MAX)
3581 lwerror(
"Unexpected error: %d faces found when expecting 1", i);
3590 LWDEBUG(1,
"BBOX of changed edge did not change");
3593 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.
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.
static uint64_t lwt_be_updateFacesById(LWT_TOPOLOGY *topo, const LWT_ISO_FACE *faces, uint64_t numfaces)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static int _lwt_InitEdgeEndByLine(edgeend *fee, edgeend *lee, LWLINE *edge, POINT2D *fp, POINT2D *lp)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
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_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_FindAdjacentEdges(LWT_TOPOLOGY *topo, LWT_ELEMID node, edgeend *data, edgeend *other, int myedge_id)
static LWT_ISO_NODE * lwt_be_getNodeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
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)
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
const LWT_BE_IFACE * be_iface