Changes the shape of an edge without affecting the topology structure.
3245 lwerror(
"SQL/MM Spatial exception - curve not simple");
3254 "lwt_be_getEdgeById returned NULL and set i=%d", i);
3255 if (i == UINT64_MAX)
3262 lwerror(
"SQL/MM Spatial exception - non-existent edge %"
3268 lwerror(
"Backend coding error: getEdgeById callback returned NULL "
3269 "but numelements output parameter has value %d "
3270 "(expected 0 or 1)", i);
3276 "old edge has %d points, new edge has %d points",
3287 lwerror(
"SQL/MM Spatial exception - "
3288 "start node not geometry start point.");
3299 " has less than 2 vertices", oldedge->
edge_id);
3303 if ( geom->points->npoints < 2 )
3306 lwerror(
"Invalid edge: less than 2 vertices");
3309 getPoint2d_p(geom->points, geom->points->npoints-1, &pt);
3313 lwerror(
"SQL/MM Spatial exception - "
3314 "end node not geometry end point.");
3330 lwerror(
"Invalid edge (no two distinct vertices exist)");
3339 lwerror(
"Edge twist at node POINT(%g %g)", p1.
x, p1.
y);
3345 oldedge->
end_node, geom, edge_id ) )
3352 LWDEBUG(1,
"lwt_ChangeEdgeGeom: "
3353 "edge crossing check passed ");
3371 LWDEBUGF(1,
"lwt_be_getNodeWithinBox2D returned %d nodes", numnodes);
3372 if (numnodes == UINT64_MAX)
3379 if ( numnodes > ( 1 + isclosed ? 0 : 1 ) )
3382 for (i=0; i<numnodes; ++i)
3395 lwerror(
"Edge motion collision at %s", wkt);
3403 LWDEBUG(1,
"nodes containment check passed");
3416 isclosed ? &epan_pre : NULL, edge_id );
3418 isclosed ? &span_pre : NULL, edge_id );
3428 newedge.
geom = geom;
3439 lwerror(
"Unexpected error: %d edges updated when expecting 1", i);
3452 isclosed ? &epan_post : NULL, edge_id );
3454 isclosed ? &span_post : NULL, edge_id );
3469 lwerror(
"Edge changed disposition around start node %"
3480 lwerror(
"Edge changed disposition around end node %"
3498 uint64_t facestoupdate = 0;
3505 lwerror(
"Corrupted topology: face %d, left of edge %d, has no bbox",
3511 faces[facestoupdate++].
mbr = updatedBox;
3520 lwerror(
"Corrupted topology: face %d, right of edge %d, has no bbox",
3526 faces[facestoupdate++].
mbr = updatedBox;
3528 LWDEBUGF(1,
"%d faces to update", facestoupdate);
3529 if ( facestoupdate )
3532 if (updatedFaces != facestoupdate)
3534 while ( facestoupdate-- )
lwfree(faces[facestoupdate].mbr);
3536 if (updatedFaces == UINT64_MAX)
3539 lwerror(
"Unexpected error: %d faces updated when expecting 1", updatedFaces);
3543 while ( facestoupdate-- )
lwfree(faces[facestoupdate].mbr);
3547 LWDEBUG(1,
"BBOX of changed edge did not change");
3550 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)
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)
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)
static GBOX * lwt_be_computeFaceMBR(const LWT_TOPOLOGY *topo, LWT_ELEMID 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)
#define P2D_SAME_STRICT(a, b)
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