[SCM] PostGIS branch master updated. 3.5.0-17-ga30c3f568
git at osgeo.org
git at osgeo.org
Wed Oct 9 01:49:56 PDT 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via a30c3f56873733fda406f7868f425476236f7496 (commit)
from 4fcfd0fd64b9b42c8120aa2cd9a4f16733cae863 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a30c3f56873733fda406f7868f425476236f7496
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Oct 9 10:49:21 2024 +0200
Fix more debug formats, add more TODO comments
diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c
index 38721c222..bfdcf137e 100644
--- a/liblwgeom/topo/lwgeom_topo.c
+++ b/liblwgeom/topo/lwgeom_topo.c
@@ -984,7 +984,7 @@ _lwt_EdgeSplit( LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipISOChe
LWDEBUGG(2, lwline_as_lwgeom(oldedge[0]->geom), "Edge to be split");
if ( ! *oldedge )
{
- LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%d", i);
+ LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%lu", i);
if (i == UINT64_MAX)
{
PGTOPO_BE_ERROR();
@@ -1563,7 +1563,7 @@ _lwt_FindAdjacentEdges( LWT_TOPOLOGY* topo, LWT_ELEMID node, edgeend *data,
return 0;
}
- LWDEBUGF(1, "getEdgeByNode returned %d edges, minaz=%g, maxaz=%g",
+ LWDEBUGF(1, "getEdgeByNode returned %lu edges, minaz=%g, maxaz=%g",
numedges, minaz, maxaz);
/* For each incident edge-end (1 or 2): */
@@ -1829,7 +1829,7 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num
for ( i=0; i<num_signed_edge_ids; ++i )
{
LWT_ELEMID eid = signed_edge_ids[i];
- LWDEBUGF(2, "Edge %d in ring is edge %" LWTFMT_ELEMID, i, eid);
+ LWDEBUGF(2, "Edge %lu in ring is edge %" LWTFMT_ELEMID, i, eid);
LWT_ISO_EDGE *edge = NULL;
POINTARRAY *epa;
for ( j=0; j<numedges; ++j )
@@ -1918,7 +1918,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
PGTOPO_BE_ERROR();
return -2;
}
- LWDEBUGF(1, "getRingEdges returned %d edges", num_signed_edge_ids);
+ LWDEBUGF(1, "getRingEdges returned %lu edges", num_signed_edge_ids);
/* You can't get to the other side of an edge forming a ring */
for (i=0; i<num_signed_edge_ids; ++i) {
@@ -2085,7 +2085,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
PGTOPO_BE_ERROR();
return -2;
}
- LWDEBUGF(1, "_lwt_AddFaceSplit: lwt_be_getEdgeByFace(%d) returned %d edges", face, numfaceedges);
+ LWDEBUGF(1, "_lwt_AddFaceSplit: lwt_be_getEdgeByFace(%" LWTFMT_ELEMID ") returned %lu edges", face, numfaceedges);
if ( numfaceedges )
{
@@ -2109,7 +2109,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
if ( seid == e->edge_id )
{
/* IDEA: remove entry from signed_edge_ids, to speed next loop ? */
- LWDEBUGF(1, "Edge %d is a known forward edge of the new ring", e->edge_id);
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " is a known forward edge of the new ring", e->edge_id);
forward_edges[forward_edges_count].edge_id = e->edge_id;
forward_edges[forward_edges_count++].face_left = newface.face_id;
found++;
@@ -2118,7 +2118,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
else if ( -seid == e->edge_id )
{
/* IDEA: remove entry from signed_edge_ids, to speed next loop ? */
- LWDEBUGF(1, "Edge %d is a known backward edge of the new ring", e->edge_id);
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " is a known backward edge of the new ring", e->edge_id);
backward_edges[backward_edges_count].edge_id = e->edge_id;
backward_edges[backward_edges_count++].face_right = newface.face_id;
found++;
@@ -2126,7 +2126,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
}
}
if ( found ) continue;
- LWDEBUGF(1, "Edge %d is not a known edge of the new ring", e->edge_id);
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " is not a known edge of the new ring", e->edge_id);
/* Check if the edge is now binding a different face */
@@ -2145,7 +2145,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
* shellbox to do it here */
contains = ptarray_contains_point(pa, &ep);
- LWDEBUGF(1, "Edge %d first point %s new ring",
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " first point %s new ring",
e->edge_id, (contains == LW_INSIDE ? "inside" :
contains == LW_OUTSIDE ? "outside" : "on boundary of"));
@@ -2154,7 +2154,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
{
if ( contains != LW_OUTSIDE )
{
- LWDEBUGF(1, "Edge %d not outside of the new ring, not updating it",
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " not outside of the new ring, not updating it",
e->edge_id);
continue;
}
@@ -2163,7 +2163,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
{
if ( contains != LW_INSIDE )
{
- LWDEBUGF(1, "Edge %d not inside the new ring, not updating it",
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " not inside the new ring, not updating it",
e->edge_id);
continue;
}
@@ -2172,7 +2172,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
/* (2.3) push to forward_edges if left_face = oface */
if ( e->face_left == face )
{
- LWDEBUGF(1, "Edge %d has new face on the left side", e->edge_id);
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " has new face on the left side", e->edge_id);
forward_edges[forward_edges_count].edge_id = e->edge_id;
forward_edges[forward_edges_count++].face_left = newface.face_id;
}
@@ -2180,7 +2180,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
/* (2.4) push to backward_edges if right_face = oface */
if ( e->face_right == face )
{
- LWDEBUGF(1, "Edge %d has new face on the right side", e->edge_id);
+ LWDEBUGF(1, "Edge %" LWTFMT_ELEMID " has new face on the right side", e->edge_id);
backward_edges[backward_edges_count].edge_id = e->edge_id;
backward_edges[backward_edges_count++].face_right = newface.face_id;
}
@@ -2253,14 +2253,14 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
LWT_ISO_NODE *n = &(nodes[i]);
const POINT2D *pt = getPoint2d_cp(n->geom->point, 0);
int contains = ptarray_contains_point(pa, pt) == LW_INSIDE;
- LWDEBUGF(1, "Node %d is %scontained in new ring, newface is %s",
+ LWDEBUGF(1, "Node %" LWTFMT_ELEMID " is %scontained in new ring, newface is %s",
n->node_id, contains ? "" : "not ",
newface_outside ? "outside" : "inside" );
if ( newface_outside )
{
if ( contains )
{
- LWDEBUGF(1, "Node %d contained in an hole of the new face",
+ LWDEBUGF(1, "Node %" LWTFMT_ELEMID " contained in an hole of the new face",
n->node_id);
continue;
}
@@ -2269,7 +2269,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
{
if ( ! contains )
{
- LWDEBUGF(1, "Node %d not contained in the face shell",
+ LWDEBUGF(1, "Node %" LWTFMT_ELEMID " not contained in the face shell",
n->node_id);
continue;
}
@@ -2277,7 +2277,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
updated_nodes[nodes_to_update].node_id = n->node_id;
updated_nodes[nodes_to_update++].containing_face =
newface.face_id;
- LWDEBUGF(1, "Node %d will be updated", n->node_id);
+ LWDEBUGF(1, "Node %" LWTFMT_ELEMID " will be updated", n->node_id);
}
_lwt_release_nodes(nodes, numisonodes);
if ( nodes_to_update )
@@ -2324,8 +2324,8 @@ _lwt_AddEdge( LWT_TOPOLOGY* topo,
uint64_t num_nodes;
LWT_ISO_NODE *endpoints;
uint64_t i;
- int prev_left;
- int prev_right;
+ LWT_ELEMID prev_left;
+ LWT_ELEMID prev_right;
LWT_ISO_EDGE seledge;
LWT_ISO_EDGE updedge;
@@ -2429,7 +2429,8 @@ _lwt_AddEdge( LWT_TOPOLOGY* topo,
}
}
- LWDEBUGF(1, "Node %d, with geom %p (looking for %d and %d)",
+ LWDEBUGF(1, "Node %" LWTFMT_ELEMID ", with geom %p (looking for %"
+ LWTFMT_ELEMID " and %" LWTFMT_ELEMID ")",
node->node_id, node->geom, start_node, end_node);
if ( node->node_id == start_node ) {
start_node_geom = node->geom;
@@ -2874,7 +2875,7 @@ lwt_GetFaceGeometry(LWT_TOPOLOGY* topo, LWT_ELEMID faceid)
PGTOPO_BE_ERROR();
return NULL;
}
- LWDEBUGF(1, "lwt_GetFaceGeometry: lwt_be_getEdgeByFace returned %d edges", numfaceedges);
+ LWDEBUGF(1, "lwt_GetFaceGeometry: lwt_be_getEdgeByFace returned %lu edges", numfaceedges);
if ( numfaceedges == 0 )
{
@@ -3122,7 +3123,7 @@ lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face_id, LWT_ELEMID **out )
return -1;
}
if ( ! numfaceedges ) return 0; /* no edges in output */
- LWDEBUGF(1, "lwt_GetFaceEdges: lwt_be_getEdgeByFace returned %d edges", numfaceedges);
+ LWDEBUGF(1, "lwt_GetFaceEdges: lwt_be_getEdgeByFace returned %lu edges", numfaceedges);
/* order edges by occurrence in face */
@@ -3283,7 +3284,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
if ( ! oldedge )
{
LWDEBUGF(1, "lwt_ChangeEdgeGeom: "
- "lwt_be_getEdgeById returned NULL and set i=%d", i);
+ "lwt_be_getEdgeById returned NULL and set i=%lu", i);
if (i == UINT64_MAX)
{
PGTOPO_BE_ERROR();
@@ -3400,7 +3401,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
uint64_t numnodes;
nodes = lwt_be_getNodeWithinBox2D(topo, &mbox, &numnodes,
LWT_COL_NODE_ALL, 0);
- LWDEBUGF(1, "lwt_be_getNodeWithinBox2D returned %d nodes", numnodes);
+ LWDEBUGF(1, "lwt_be_getNodeWithinBox2D returned %lu nodes", numnodes);
if (numnodes == UINT64_MAX)
{
_lwt_release_edges(oldedge, 1);
@@ -3483,7 +3484,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
PGTOPO_BE_ERROR();
return -1;
}
- LWDEBUGF(1, "getRingEdges returned %d edges", num_signed_edge_ids);
+ LWDEBUGF(1, "getRingEdges returned %lu edges", num_signed_edge_ids);
shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids);
if ( ! shell ) {
@@ -3587,7 +3588,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
PGTOPO_BE_ERROR();
return -1;
}
- LWDEBUGF(1, "getRingEdges returned %d edges", num_signed_edge_ids);
+ LWDEBUGF(1, "getRingEdges returned %lu edges", num_signed_edge_ids);
shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids);
if ( ! shell ) {
@@ -3668,7 +3669,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
/* ownership transferred to faces[] */
faces[facestoupdate++].mbr = updatedBox;
}
- LWDEBUGF(1, "%d faces to update", facestoupdate);
+ LWDEBUGF(1, "%lu faces to update", facestoupdate);
if ( facestoupdate )
{
uint64_t updatedFaces = lwt_be_updateFacesById(topo, &(faces[0]), facestoupdate);
@@ -4005,7 +4006,7 @@ _lwt_RemEdge( LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, int modFace )
edge = lwt_be_getEdgeById(topo, &edge_id, &i, LWT_COL_EDGE_ALL);
if (!edge)
{
- LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%d", i);
+ LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%lu", i);
if (i == UINT64_MAX)
{
PGTOPO_BE_ERROR();
@@ -4119,7 +4120,7 @@ _lwt_RemEdge( LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, int modFace )
return -1;
}
}
- LWDEBUGF(1, "releasing %d updateable edges in %p", nedges, upd_edge);
+ LWDEBUGF(1, "releasing %lu updateable edges in %p", nedges, upd_edge);
lwfree(upd_edge);
/* Id of face that will take up all the space previously
@@ -5229,7 +5230,7 @@ _lwt_SnapEdgeToExistingNode(
}
LWT_NODE_EDGES *splitNodeEdges = lwt_nodeEdges_loadFromDB(topo, node->node_id, LWT_COL_EDGE_ALL);
if ( ! splitNodeEdges ) {
- lwerror("No edges found in DB to be incident to split node first node");
+ lwerror("No edges found in DB to be incident to split node");
return -1;
}
@@ -5384,6 +5385,8 @@ _lwt_SnapEdgeToExistingNode(
if ( ( replacedBy[0] != 0 && replacedBy[1] == 0 ) ||
( replacedBy[1] != 0 && replacedBy[0] == 0 ) )
{
+ /* One side of the snapped edge collapsed to an existing edge */
+
LWT_ISO_EDGE *existingEdge;
edgeend *splitNodeEdgeEndInfo;
LWLINE *newSplitEdgeLine;
@@ -5407,6 +5410,7 @@ _lwt_SnapEdgeToExistingNode(
}
/* TODO: check that newSplitEdgeLine part does not crosses any other edge ? */
+ /* TODO: check that newSplitEdgeLine retains its position in the edge end star (see ticket #5786) */
LWDEBUGF(1, "Existing edge %"
LWTFMT_ELEMID " (post-modEdgeSplit) next_right:%"
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/topo/lwgeom_topo.c | 64 +++++++++++++++++++++++---------------------
1 file changed, 34 insertions(+), 30 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list