5244{
5247 uint64_t num, i;
5249 GEOSGeometry *edgeg;
5251
5253 if (num == UINT64_MAX)
5254 {
5256 return -1;
5257 }
5258 if ( num )
5259 {
5261
5263 if ( ! edgeg )
5264 {
5267 return -1;
5268 }
5269 for (i=0; i<num; ++i)
5270 {
5273 GEOSGeometry *gg;
5274 int equals;
5276 if ( ! gg )
5277 {
5278 GEOSGeom_destroy(edgeg);
5281 return -1;
5282 }
5283 equals = GEOSEquals(gg, edgeg);
5284 GEOSGeom_destroy(gg);
5285 if ( equals == 2 )
5286 {
5287 GEOSGeom_destroy(edgeg);
5290 return -1;
5291 }
5292 if ( equals )
5293 {
5295 GEOSGeom_destroy(edgeg);
5297 return id;
5298 }
5299 }
5300 GEOSGeom_destroy(edgeg);
5302 }
5303
5304 return 0;
5305}
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
void lwgeom_geos_error(const char *fmt,...)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_GEOM
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
static LWT_ISO_EDGE * lwt_be_getEdgeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
const LWT_BE_IFACE * be_iface