1084{
1087 uint64_t i;
1088
1089
1090 i = 1;
1091 LWDEBUG(1,
"calling lwt_be_getEdgeById");
1093 LWDEBUGF(1,
"lwt_be_getEdgeById returned %p", *oldedge);
1095 if ( ! *oldedge )
1096 {
1097 LWDEBUGF(1,
"lwt_be_getEdgeById returned NULL and set i=%llu", i);
1098 if (i == UINT64_MAX)
1099 {
1101 return NULL;
1102 }
1103 else if ( i == 0 )
1104 {
1105 lwerror(
"SQL/MM Spatial exception - non-existent edge");
1106 return NULL;
1107 }
1108 else
1109 {
1110 lwerror(
"Backend coding error: getEdgeById callback returned NULL "
1111 "but numelements output parameter has value %" PRIu64
1112 "(expected 0 or 1)", i);
1113 return NULL;
1114 }
1115 }
1116
1117
1118
1119
1120
1121 if ( ! skipISOChecks )
1122 {
1123 LWDEBUG(1,
"calling lwt_be_ExistsCoincidentNode");
1125 {
1126 LWDEBUG(1,
"lwt_be_ExistsCoincidentNode returned");
1128 lwerror(
"SQL/MM Spatial exception - coincident node");
1129 return NULL;
1130 }
1131 LWDEBUG(1,
"lwt_be_ExistsCoincidentNode returned");
1132 }
1133
1134
1136 if ( ! split )
1137 {
1139 lwerror(
"could not split edge by point ?");
1140 return NULL;
1141 }
1143 if ( ! split_col ) {
1146 lwerror(
"lwgeom_as_lwcollection returned NULL");
1147 return NULL;
1148 }
1149 if (split_col->
ngeoms < 2) {
1153 lwerror(
"SQL/MM Spatial exception - point not on edge");
1154 return NULL;
1155 }
1156
1157#if POSTGIS_DEBUG_LEVEL > 1
1158 {
1159 size_t sz;
1161 LWDEBUGF(1,
"returning split col: %s", wkt);
1163 }
1164#endif
1165 return split_col;
1166}
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)