967{
970 uint64_t i;
971
972
973 i = 1;
974 LWDEBUG(1,
"calling lwt_be_getEdgeById");
976 LWDEBUGF(1,
"lwt_be_getEdgeById returned %p", *oldedge);
978 if ( ! *oldedge )
979 {
980 LWDEBUGF(1,
"lwt_be_getEdgeById returned NULL and set i=%llu", i);
981 if (i == UINT64_MAX)
982 {
984 return NULL;
985 }
986 else if ( i == 0 )
987 {
988 lwerror(
"SQL/MM Spatial exception - non-existent edge");
989 return NULL;
990 }
991 else
992 {
993 lwerror(
"Backend coding error: getEdgeById callback returned NULL "
994 "but numelements output parameter has value %" PRIu64
995 "(expected 0 or 1)", i);
996 return NULL;
997 }
998 }
999
1000
1001
1002
1003
1004 if ( ! skipISOChecks )
1005 {
1006 LWDEBUG(1,
"calling lwt_be_ExistsCoincidentNode");
1008 {
1009 LWDEBUG(1,
"lwt_be_ExistsCoincidentNode returned");
1011 lwerror(
"SQL/MM Spatial exception - coincident node");
1012 return NULL;
1013 }
1014 LWDEBUG(1,
"lwt_be_ExistsCoincidentNode returned");
1015 }
1016
1017
1019 if ( ! split )
1020 {
1022 lwerror(
"could not split edge by point ?");
1023 return NULL;
1024 }
1026 if ( ! split_col ) {
1029 lwerror(
"lwgeom_as_lwcollection returned NULL");
1030 return NULL;
1031 }
1032 if (split_col->
ngeoms < 2) {
1036 lwerror(
"SQL/MM Spatial exception - point not on edge");
1037 return NULL;
1038 }
1039
1040#if POSTGIS_DEBUG_LEVEL > 1
1041 {
1042 size_t sz;
1044 LWDEBUGF(1,
"returning split col: %s", wkt);
1046 }
1047#endif
1048 return split_col;
1049}
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
LWGEOM * lwgeom_split(const LWGEOM *lwgeom_in, const LWGEOM *blade_in)
void lwgeom_free(LWGEOM *geom)
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
#define PGTOPO_BE_ERROR()
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
#define LWDEBUGG(level, geom, msg)
LWT_ELEMID lwt_be_ExistsCoincidentNode(LWT_TOPOLOGY *topo, const LWPOINT *pt)
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)