PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ lwt_ChangeEdgeGeom()

int lwt_ChangeEdgeGeom ( LWT_TOPOLOGY topo,
LWT_ELEMID  edge,
LWLINE curve 
)

Changes the shape of an edge without affecting the topology structure.

For ST_ChangeEdgeGeom

Parameters
topothe topology to operate on
curvethe edge geometry
Returns
0 on success, -1 on error (liblwgeom error handler will be invoked with error message)

Definition at line 3260 of file lwgeom_topo.c.

3261 {
3262  LWT_ISO_EDGE *oldedge;
3263  LWT_ISO_EDGE newedge;
3264  POINT2D p1, p2, pt;
3265  uint64_t i;
3266  int isclosed = 0;
3267  int leftRingIsCCW = -1;
3268 
3269  /* curve must be simple */
3270  if ( ! lwgeom_is_simple(lwline_as_lwgeom(geom)) )
3271  {
3272  lwerror("SQL/MM Spatial exception - curve not simple");
3273  return -1;
3274  }
3275 
3276  i = 1;
3277  oldedge = lwt_be_getEdgeById(topo, &edge_id, &i, LWT_COL_EDGE_ALL);
3278  if ( ! oldedge )
3279  {
3280  LWDEBUGF(1, "lwt_ChangeEdgeGeom: "
3281  "lwt_be_getEdgeById returned NULL and set i=%llu", i);
3282  if (i == UINT64_MAX)
3283  {
3284  PGTOPO_BE_ERROR();
3285  return -1;
3286  }
3287  else if ( i == 0 )
3288  {
3289  lwerror("SQL/MM Spatial exception - non-existent edge %"
3290  LWTFMT_ELEMID, edge_id);
3291  return -1;
3292  }
3293  else
3294  {
3295  lwerror("Backend coding error: getEdgeById callback returned NULL "
3296  "but numelements output parameter has value %" PRIu64 " "
3297  "(expected 0 or 1)", i);
3298  return -1;
3299  }
3300  }
3301 
3302  LWDEBUGF(1, "lwt_ChangeEdgeGeom: "
3303  "old edge has %d points, new edge has %d points",
3304  oldedge->geom->points->npoints, geom->points->npoints);
3305 
3306  /*
3307  * e) Check StartPoint consistency
3308  */
3309  getPoint2d_p(oldedge->geom->points, 0, &p1);
3310  getPoint2d_p(geom->points, 0, &pt);
3311  if ( ! P2D_SAME_STRICT(&p1, &pt) )
3312  {
3313  _lwt_release_edges(oldedge, 1);
3314  lwerror("SQL/MM Spatial exception - "
3315  "start node not geometry start point.");
3316  return -1;
3317  }
3318 
3319  /*
3320  * f) Check EndPoint consistency
3321  */
3322  if ( oldedge->geom->points->npoints < 2 )
3323  {
3324  _lwt_release_edges(oldedge, 1);
3325  lwerror("Corrupted topology: edge %" LWTFMT_ELEMID
3326  " has less than 2 vertices", oldedge->edge_id);
3327  return -1;
3328  }
3329  getPoint2d_p(oldedge->geom->points, oldedge->geom->points->npoints-1, &p2);
3330  if ( geom->points->npoints < 2 )
3331  {
3332  _lwt_release_edges(oldedge, 1);
3333  lwerror("Invalid edge: less than 2 vertices");
3334  return -1;
3335  }
3336  getPoint2d_p(geom->points, geom->points->npoints-1, &pt);
3337  if ( ! P2D_SAME_STRICT(&pt, &p2) )
3338  {
3339  _lwt_release_edges(oldedge, 1);
3340  lwerror("SQL/MM Spatial exception - "
3341  "end node not geometry end point.");
3342  return -1;
3343  }
3344 
3345  /* Not in the specs:
3346  * if the edge is closed, check we didn't change winding !
3347  * (should be part of isomorphism checking)
3348  */
3349  if ( oldedge->start_node == oldedge->end_node )
3350  {
3351  isclosed = 1;
3352 #if 1 /* TODO: this is actually bogus as a test */
3353  /* check for valid edge (distinct vertices must exist) */
3354  if ( ! _lwt_GetInteriorEdgePoint(geom, &pt) )
3355  {
3356  _lwt_release_edges(oldedge, 1);
3357  lwerror("Invalid edge (no two distinct vertices exist)");
3358  return -1;
3359  }
3360 #endif
3361 
3362  if ( ptarray_isccw(oldedge->geom->points) !=
3363  ptarray_isccw(geom->points) )
3364  {
3365  _lwt_release_edges(oldedge, 1);
3366  lwerror("Edge twist at node POINT(%g %g)", p1.x, p1.y);
3367  return -1;
3368  }
3369  }
3370 
3371  if ( _lwt_CheckEdgeCrossing(topo, oldedge->start_node,
3372  oldedge->end_node, geom, edge_id ) )
3373  {
3374  /* would have called lwerror already, leaking :( */
3375  _lwt_release_edges(oldedge, 1);
3376  return -1;
3377  }
3378 
3379  LWDEBUG(1, "lwt_ChangeEdgeGeom: "
3380  "edge crossing check passed ");
3381 
3382  /*
3383  * Not in the specs:
3384  * Check topological isomorphism
3385  */
3386 
3387  /* Check that the "motion range" doesn't include any node */
3388  // 1. compute combined bbox of old and new edge
3389  GBOX mbox; /* motion box */
3390  lwgeom_add_bbox((LWGEOM*)oldedge->geom); /* just in case */
3391  lwgeom_add_bbox((LWGEOM*)geom); /* just in case */
3392  gbox_union(oldedge->geom->bbox, geom->bbox, &mbox);
3393  // 2. fetch all nodes in the combined box
3394  LWT_ISO_NODE *nodes;
3395  uint64_t numnodes;
3396  nodes = lwt_be_getNodeWithinBox2D(topo, &mbox, &numnodes,
3397  LWT_COL_NODE_ALL, 0);
3398  LWDEBUGF(1, "lwt_be_getNodeWithinBox2D returned %llu nodes", numnodes);
3399  if (numnodes == UINT64_MAX)
3400  {
3401  _lwt_release_edges(oldedge, 1);
3402  PGTOPO_BE_ERROR();
3403  return -1;
3404  }
3405  // 3. if any node beside endnodes are found:
3406  if ( numnodes > ( 1 + isclosed ? 0 : 1 ) )
3407  {{
3408  // 3.2. bail out if any node is in one and not the other
3409  for (i=0; i<numnodes; ++i)
3410  {
3411  LWT_ISO_NODE *n = &(nodes[i]);
3412  if ( n->node_id == oldedge->start_node ) continue;
3413  if ( n->node_id == oldedge->end_node ) continue;
3414  const POINT2D *pt = getPoint2d_cp(n->geom->point, 0);
3415  int ocont = ptarray_contains_point_partial(oldedge->geom->points, pt, isclosed, NULL) == LW_INSIDE;
3416  int ncont = ptarray_contains_point_partial(geom->points, pt, isclosed, NULL) == LW_INSIDE;
3417  if (ocont != ncont)
3418  {
3419  size_t sz;
3420  char *wkt = lwgeom_to_wkt(lwpoint_as_lwgeom(n->geom), WKT_ISO, 15, &sz);
3421  _lwt_release_nodes(nodes, numnodes);
3422  lwerror("Edge motion collision at %s", wkt);
3423  lwfree(wkt); /* would not necessarely reach this point */
3424  return -1;
3425  }
3426  }
3427  }}
3428  if ( numnodes ) _lwt_release_nodes(nodes, numnodes);
3429 
3430  LWDEBUG(1, "nodes containment check passed");
3431 
3432  /*
3433  * Check edge adjacency before
3434  * TODO: can be optimized to gather azimuths of all edge ends once
3435  */
3436 
3437  edgeend span_pre, epan_pre;
3438  /* initialize span_pre.myaz and epan_pre.myaz with existing edge */
3439  int res = _lwt_InitEdgeEndByLine(&span_pre, &epan_pre, oldedge->geom, &p1, &p2);
3440  if (res)
3441  return -1; /* lwerror should have been raised */
3442  _lwt_FindAdjacentEdges( topo, oldedge->start_node, &span_pre,
3443  isclosed ? &epan_pre : NULL, edge_id );
3444  _lwt_FindAdjacentEdges( topo, oldedge->end_node, &epan_pre,
3445  isclosed ? &span_pre : NULL, edge_id );
3446 
3447  LWDEBUGF(1, "edges adjacent to old edge are %" LWTFMT_ELEMID
3448  " and %" LWTFMT_ELEMID " (first point), %" LWTFMT_ELEMID
3449  " and %" LWTFMT_ELEMID " (last point)",
3450  span_pre.nextCW, span_pre.nextCCW,
3451  epan_pre.nextCW, epan_pre.nextCCW);
3452 
3453  /* If the same edge is both on CW and CCW direction on both start
3454  * and end points we need to verify winding of the left and right
3455  * rings to verify we didn't twist.
3456  * See https://trac.osgeo.org/postgis/ticket/5787
3457  *
3458  * NOTE: this could probably replace the "isclosed" test.
3459  *
3460  * NOTE: if either start or end node had different CW and CCW
3461  * edges a twist would be caught in the previous check.
3462  */
3463  if ( ! isclosed &&
3464  oldedge->face_left != oldedge->face_right &&
3465  span_pre.nextCW == span_pre.nextCCW &&
3466  epan_pre.nextCW == epan_pre.nextCCW )
3467  {{
3468  uint64_t num_signed_edge_ids;
3469  LWT_ELEMID *signed_edge_ids;
3470  LWPOLY *shell;
3471 
3472  LWDEBUG(1, "Twist check before");
3473  signed_edge_ids = lwt_be_getRingEdges(topo, edge_id, &num_signed_edge_ids, 0);
3474  /* Get winding of left face ring */
3475  if (!signed_edge_ids)
3476  {
3477  //PGTOPO_BE_ERRORF("no ring edges for edge %" LWTFMT_ELEMID, sedge);
3478  PGTOPO_BE_ERROR();
3479  return -1;
3480  }
3481  LWDEBUGF(1, "getRingEdges returned %llu edges", num_signed_edge_ids);
3482 
3483  shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids);
3484  if ( ! shell ) {
3485  lwfree( signed_edge_ids );
3486  /* ring_edges should be NULL */
3487  lwerror("Could not create ring shell: %s", lwt_be_lastErrorMessage(topo->be_iface));
3488  return -1;
3489  }
3490 
3491  const POINTARRAY *pa = shell->rings[0];
3492  if ( ! ptarray_is_closed_2d(pa) )
3493  {
3494  lwpoly_free(shell);
3495  lwfree( signed_edge_ids );
3496  lwerror("Corrupted topology: ring of edge %" LWTFMT_ELEMID
3497  " is geometrically not-closed", edge_id);
3498  return -1;
3499  }
3500 
3501  leftRingIsCCW = ptarray_isccw(pa);
3502  lwpoly_free(shell);
3503  lwfree( signed_edge_ids );
3504 
3505  LWDEBUGF(1, "Ring of edge %" LWTFMT_ELEMID " is %sclockwise", edge_id, leftRingIsCCW ? "counter" : "");
3506  }}
3507 
3508 
3509  /* update edge geometry */
3510  newedge.edge_id = edge_id;
3511  newedge.geom = geom;
3512  res = lwt_be_updateEdgesById(topo, &newedge, 1, LWT_COL_EDGE_GEOM);
3513  if (res == -1)
3514  {
3515  _lwt_release_edges(oldedge, 1);
3516  PGTOPO_BE_ERROR();
3517  return -1;
3518  }
3519  if (!res)
3520  {
3521  _lwt_release_edges(oldedge, 1);
3522  lwerror("Unexpected error: %" PRIu64 " edges updated when expecting 1", i);
3523  return -1;
3524  }
3525 
3526  /*
3527  * Check edge adjacency after
3528  */
3529  edgeend span_post, epan_post;
3530  /* initialize epan_post.myaz and epan_post.myaz */
3531  res = _lwt_InitEdgeEndByLine(&span_post, &epan_post, geom, &p1, &p2);
3532  if (res)
3533  return -1; /* lwerror should have been raised */
3534  _lwt_FindAdjacentEdges( topo, oldedge->start_node, &span_post,
3535  isclosed ? &epan_post : NULL, edge_id );
3536  _lwt_FindAdjacentEdges( topo, oldedge->end_node, &epan_post,
3537  isclosed ? &span_post : NULL, edge_id );
3538 
3539  LWDEBUGF(1, "edges adjacent to new edge are %" LWTFMT_ELEMID
3540  " and %" LWTFMT_ELEMID " (first point), %" LWTFMT_ELEMID
3541  " and %" LWTFMT_ELEMID " (last point)",
3542  span_pre.nextCW, span_pre.nextCCW,
3543  epan_pre.nextCW, epan_pre.nextCCW);
3544 
3545 
3546  /* Bail out if next CW or CCW edge on start node changed */
3547  if ( span_pre.nextCW != span_post.nextCW ||
3548  span_pre.nextCCW != span_post.nextCCW )
3549  {{
3550  LWT_ELEMID nid = oldedge->start_node;
3551  _lwt_release_edges(oldedge, 1);
3552  lwerror("Edge changed disposition around start node %"
3553  LWTFMT_ELEMID, nid);
3554  return -1;
3555  }}
3556 
3557  /* Bail out if next CW or CCW edge on end node changed */
3558  if ( epan_pre.nextCW != epan_post.nextCW ||
3559  epan_pre.nextCCW != epan_post.nextCCW )
3560  {{
3561  LWT_ELEMID nid = oldedge->end_node;
3562  _lwt_release_edges(oldedge, 1);
3563  lwerror("Edge changed disposition around end node %"
3564  LWTFMT_ELEMID, nid);
3565  return -1;
3566  }}
3567 
3568  /* Check winding of left face ring did not change */
3569  if ( leftRingIsCCW != -1 )
3570  {{
3571  uint64_t num_signed_edge_ids;
3572  LWT_ELEMID *signed_edge_ids;
3573  LWPOLY *shell;
3574  int isCCW;
3575 
3576  LWDEBUG(1, "Twist check after");
3577  signed_edge_ids = lwt_be_getRingEdges(topo, edge_id, &num_signed_edge_ids, 0);
3578  /* Get winding of left face ring */
3579  if (!signed_edge_ids)
3580  {
3581  //PGTOPO_BE_ERRORF("no ring edges for edge %" LWTFMT_ELEMID, sedge);
3582  PGTOPO_BE_ERROR();
3583  return -1;
3584  }
3585  LWDEBUGF(1, "getRingEdges returned %llu edges", num_signed_edge_ids);
3586 
3587  shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids);
3588  if ( ! shell ) {
3589  lwfree( signed_edge_ids );
3590  /* ring_edges should be NULL */
3591  lwerror("Could not create ring shell: %s", lwt_be_lastErrorMessage(topo->be_iface));
3592  return -1;
3593  }
3594 
3595  const POINTARRAY *pa = shell->rings[0];
3596  if ( ! ptarray_is_closed_2d(pa) )
3597  {
3598  lwpoly_free(shell);
3599  lwfree( signed_edge_ids );
3600  lwerror("Corrupted topology: ring of edge %" LWTFMT_ELEMID
3601  " is geometrically not-closed", edge_id);
3602  return -1;
3603  }
3604 
3605  isCCW = ptarray_isccw(pa);
3606  lwpoly_free(shell);
3607  lwfree( signed_edge_ids );
3608 
3609  if ( isCCW != leftRingIsCCW )
3610  {
3611  _lwt_release_edges(oldedge, 1);
3612  lwerror("Edge ring changes winding");
3613  return -1;
3614  }
3615  }}
3616 
3617  /*
3618  -- Update faces MBR of left and right faces
3619  -- TODO: think about ways to optimize this part, like see if
3620  -- the old edge geometry participated in the definition
3621  -- of the current MBR (for shrinking) or the new edge MBR
3622  -- would be larger than the old face MBR...
3623  --
3624  */
3625  LWGEOM *oldgeom = lwline_as_lwgeom(oldedge->geom);
3626  LWGEOM *newgeom = lwline_as_lwgeom(geom);
3627  lwgeom_refresh_bbox(oldgeom); /* Ensure we use a fit mbr, see #5709 -- TODO: fix this at lower level */
3628  lwgeom_refresh_bbox(newgeom); /* Ensure we use a fit mbr, see #5709 -- TODO: fix this at lower level */
3629  const GBOX* oldbox = lwgeom_get_bbox(oldgeom);
3630  const GBOX* newbox = lwgeom_get_bbox(newgeom);
3631  if ( ! gbox_same(oldbox, newbox) )
3632  {
3633  GBOX* updatedBox;
3634  uint64_t facestoupdate = 0;
3635  LWT_ISO_FACE faces[2];
3636  if ( oldedge->face_left > 0 )
3637  {
3638  updatedBox = lwt_be_computeFaceMBR(topo, oldedge->face_left);
3639  if ( ! updatedBox )
3640  {
3641  lwerror("Corrupted topology: face %" LWTFMT_ELEMID
3642  ", left of edge %" LWTFMT_ELEMID ", has no bbox",
3643  oldedge->face_left, edge_id);
3644  return -1;
3645  }
3646  faces[facestoupdate].face_id = oldedge->face_left;
3647  /* ownership transferred to faces[] */
3648  faces[facestoupdate++].mbr = updatedBox;
3649  }
3650  if ( oldedge->face_right > 0
3651  /* no need to update twice the same face.. */
3652  && oldedge->face_right != oldedge->face_left )
3653  {
3654  updatedBox = lwt_be_computeFaceMBR(topo, oldedge->face_right);
3655  if ( ! updatedBox )
3656  {
3657  lwerror("Corrupted topology: face %"
3658  LWTFMT_ELEMID ", right of edge %" LWTFMT_ELEMID ", has no bbox",
3659  oldedge->face_right, edge_id);
3660  return -1;
3661  }
3662  faces[facestoupdate].face_id = oldedge->face_right;
3663  /* ownership transferred to faces[] */
3664  faces[facestoupdate++].mbr = updatedBox;
3665  }
3666  LWDEBUGF(1, "%llu faces to update", facestoupdate);
3667  if ( facestoupdate )
3668  {
3669  uint64_t updatedFaces = lwt_be_updateFacesById(topo, &(faces[0]), facestoupdate);
3670  if (updatedFaces != facestoupdate)
3671  {
3672  while ( facestoupdate-- ) lwfree(faces[facestoupdate].mbr);
3673  _lwt_release_edges(oldedge, 1);
3674  if (updatedFaces == UINT64_MAX)
3675  PGTOPO_BE_ERROR();
3676  else
3677  lwerror("Unexpected error: %" PRIu64 " faces updated when expecting 1", updatedFaces);
3678  return -1;
3679  }
3680  }
3681  while ( facestoupdate-- ) lwfree(faces[facestoupdate].mbr);
3682  }
3683  else
3684  {
3685  LWDEBUG(1, "BBOX of changed edge did not change");
3686  }
3687 
3688  LWDEBUG(1, "all done, cleaning up edges");
3689 
3690  _lwt_release_edges(oldedge, 1);
3691  return 0; /* success */
3692 }
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
Definition: gbox.c:164
int gbox_union(const GBOX *g1, const GBOX *g2, GBOX *gout)
Update the output GBOX to be large enough to include both inputs.
Definition: gbox.c:135
void lwgeom_refresh_bbox(LWGEOM *lwgeom)
Drop current bbox and calculate a fresh one.
Definition: lwgeom.c:707
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:339
int lwgeom_is_simple(const LWGEOM *lwgeom)
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
Definition: lwgeom_api.c:342
void lwfree(void *mem)
Definition: lwutil.c:248
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:344
#define WKT_ISO
Definition: liblwgeom.h:2216
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
Definition: lwout_wkt.c:708
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
Definition: lwgeom.c:743
int ptarray_is_closed_2d(const POINTARRAY *pa)
Definition: ptarray.c:710
void lwpoly_free(LWPOLY *poly)
Definition: lwpoly.c:175
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:695
int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number)
Definition: ptarray.c:763
#define LW_INSIDE
Constants for point-in-polygon return values.
int ptarray_isccw(const POINTARRAY *pa)
Definition: ptarray.c:1051
#define P2D_SAME_STRICT(a, b)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_ALL
#define LWT_COL_EDGE_GEOM
#define LWT_COL_NODE_ALL
#define PGTOPO_BE_ERROR()
#define LWTFMT_ELEMID
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:101
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:106
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static LWT_ELEMID * lwt_be_getRingEdges(LWT_TOPOLOGY *topo, LWT_ELEMID edge, uint64_t *numedges, uint64_t limit)
Definition: lwgeom_topo.c:373
static uint64_t lwt_be_updateFacesById(LWT_TOPOLOGY *topo, const LWT_ISO_FACE *faces, uint64_t numfaces)
Definition: lwgeom_topo.c:286
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
Definition: lwgeom_topo.c:114
static int _lwt_InitEdgeEndByLine(edgeend *fee, edgeend *lee, LWLINE *edge, POINT2D *fp, POINT2D *lp)
Definition: lwgeom_topo.c:1466
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
Definition: lwgeom_topo.c:215
static int _lwt_GetInteriorEdgePoint(const LWLINE *edge, POINT2D *ip)
Definition: lwgeom_topo.c:1746
static LWPOLY * _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num_signed_edge_ids)
Definition: lwgeom_topo.c:1779
static GBOX * lwt_be_computeFaceMBR(const LWT_TOPOLOGY *topo, LWT_ELEMID face)
Definition: lwgeom_topo.c:411
static int _lwt_CheckEdgeCrossing(LWT_TOPOLOGY *topo, LWT_ELEMID start_node, LWT_ELEMID end_node, const LWLINE *geom, LWT_ELEMID myself)
Definition: lwgeom_topo.c:606
static void _lwt_release_nodes(LWT_ISO_NODE *nodes, int num_nodes)
Definition: lwgeom_topo.c:470
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
Definition: lwgeom_topo.c:460
static LWT_ISO_NODE * lwt_be_getNodeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
Definition: lwgeom_topo.c:167
int lwt_be_updateEdgesById(LWT_TOPOLOGY *topo, const LWT_ISO_EDGE *edges, int numedges, int upd_fields)
Definition: lwgeom_topo.c:294
static int _lwt_FindAdjacentEdges(LWT_TOPOLOGY *topo, LWT_ELEMID node, edgeend *data, edgeend *other, LWT_ELEMID myedge_id)
Definition: lwgeom_topo.c:1524
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwinline.h:97
tuple res
Definition: window.py:79
GBOX * bbox
Definition: liblwgeom.h:482
POINTARRAY * points
Definition: liblwgeom.h:483
POINTARRAY * point
Definition: liblwgeom.h:471
POINTARRAY ** rings
Definition: liblwgeom.h:519
LWT_ELEMID face_right
LWT_ELEMID end_node
LWT_ELEMID face_left
LWLINE * geom
LWT_ELEMID edge_id
LWT_ELEMID start_node
LWT_ELEMID face_id
LWT_ELEMID node_id
LWPOINT * geom
const LWT_BE_IFACE * be_iface
double y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390
uint32_t npoints
Definition: liblwgeom.h:427
LWT_ELEMID nextCCW
Definition: lwgeom_topo.c:1411
LWT_ELEMID nextCW
Definition: lwgeom_topo.c:1407

References _lwt_CheckEdgeCrossing(), _lwt_FindAdjacentEdges(), _lwt_GetInteriorEdgePoint(), _lwt_InitEdgeEndByLine(), _lwt_MakeRingShell(), _lwt_release_edges(), _lwt_release_nodes(), LWLINE::bbox, LWT_TOPOLOGY_T::be_iface, LWT_ISO_EDGE::edge_id, LWT_ISO_EDGE::end_node, LWT_ISO_FACE::face_id, LWT_ISO_EDGE::face_left, LWT_ISO_EDGE::face_right, gbox_same(), gbox_union(), LWT_ISO_NODE::geom, LWT_ISO_EDGE::geom, getPoint2d_cp(), getPoint2d_p(), LW_INSIDE, LWDEBUG, LWDEBUGF, lwerror(), lwfree(), lwgeom_add_bbox(), lwgeom_get_bbox(), lwgeom_is_simple(), lwgeom_refresh_bbox(), lwgeom_to_wkt(), lwline_as_lwgeom(), lwpoint_as_lwgeom(), lwpoly_free(), lwt_be_computeFaceMBR(), lwt_be_getEdgeById(), lwt_be_getNodeWithinBox2D(), lwt_be_getRingEdges(), lwt_be_lastErrorMessage(), lwt_be_updateEdgesById(), lwt_be_updateFacesById(), LWT_COL_EDGE_ALL, LWT_COL_EDGE_GEOM, LWT_COL_NODE_ALL, LWTFMT_ELEMID, LWT_ISO_FACE::mbr, edgeend_t::nextCCW, edgeend_t::nextCW, LWT_ISO_NODE::node_id, POINTARRAY::npoints, P2D_SAME_STRICT, PGTOPO_BE_ERROR, LWPOINT::point, LWLINE::points, ptarray_contains_point_partial(), ptarray_is_closed_2d(), ptarray_isccw(), window::res, LWPOLY::rings, LWT_ISO_EDGE::start_node, WKT_ISO, POINT2D::x, and POINT2D::y.

Referenced by _lwt_SplitAllEdgesToNewNode().

Here is the call graph for this function:
Here is the caller graph for this function: