6756 double mindist = FLT_MAX;
6777 if (num == UINT64_MAX)
6784 LWDEBUGF(1,
"New point is within %.15g units of %llu nodes", tol, num);
6789 for (i=0; i<num; ++i)
6791 sorted[i].
ptr = nodes+i;
6794 ((
LWT_ISO_NODE*)(sorted[i].ptr))->node_id, sorted[i].score);
6798 for (i=0; i<num; ++i)
6807 for ( i=0; i<num; ++i )
6814 if ( dist && dist >= tol )
continue;
6815 if ( !
id || dist < mindist )
6825 if ( moved ) *moved = mindist == 0 ? 0 : 1;
6839 if (num == UINT64_MAX)
6844 LWDEBUGF(1,
"New point is within %.15g units of %llu edges", tol, num);
6856 if ( moved ) *moved = 0;
6861 lwerror(
"lwt_AddIsoNode failed");
void lwgeom_geos_error(const char *fmt,...)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
double lwgeom_mindistance2d(const LWGEOM *lw1, const LWGEOM *lw2)
Function initializing min distance calculation.
void * lwalloc(size_t size)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_NODE_GEOM
#define LWT_COL_NODE_NODE_ID
Node fields.
#define PGTOPO_BE_ERROR()
#define LWDEBUGF(level, msg,...)
void lwnotice(const char *fmt,...) __attribute__((format(printf
Write a notice out to the notice handler.
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
#define LWDEBUGG(level, geom, msg)
static LWT_ELEMID _lwt_AddIsoNode(LWT_TOPOLOGY *topo, LWT_ELEMID face, LWPOINT *pt, int skipISOChecks, int checkFace)
static void _lwt_release_nodes(LWT_ISO_NODE *nodes, int num_nodes)
static int compare_scored_pointer(const void *si1, const void *si2)
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
LWT_ISO_NODE * lwt_be_getNodeWithinDistance2D(LWT_TOPOLOGY *topo, const LWPOINT *pt, double dist, uint64_t *numelems, int fields, int64_t limit)
#define _LWT_MINTOLERANCE(topo, geom)
static LWT_ELEMID _lwt_SplitAllEdgesToNewNode(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edges, uint64_t num, LWPOINT *point, double tol, int *moved)
LWT_ISO_EDGE * lwt_be_getEdgeWithinDistance2D(LWT_TOPOLOGY *topo, const LWPOINT *pt, double dist, uint64_t *numelems, int fields, int64_t limit)
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)