5209{
5212 uint64_t num, i;
5214 GEOSGeometry *edgeg;
5216
5218 if (num == UINT64_MAX)
5219 {
5221 return -1;
5222 }
5223 if ( num )
5224 {
5226
5228 if ( ! edgeg )
5229 {
5232 return -1;
5233 }
5234 for (i=0; i<num; ++i)
5235 {
5238 GEOSGeometry *gg;
5239 int equals;
5241 if ( ! gg )
5242 {
5243 GEOSGeom_destroy(edgeg);
5246 return -1;
5247 }
5248 equals = GEOSEquals(gg, edgeg);
5249 GEOSGeom_destroy(gg);
5250 if ( equals == 2 )
5251 {
5252 GEOSGeom_destroy(edgeg);
5255 return -1;
5256 }
5257 if ( equals )
5258 {
5260
5261 if ( forward )
5262 {
5263
5265 {
5267 {
5268 *forward = 1;
5269 }
5270 else
5271 {
5272 *forward = 0;
5273 }
5274 }
5275 else
5276 {
5277
5278 if (
5279 memcmp(
5283 ) == 0
5284 )
5285 {
5286 *forward = 1;
5287 }
5288 else
5289 {
5290 *forward = 0;
5291 }
5292 }
5293 }
5294 GEOSGeom_destroy(edgeg);
5296 return id;
5297 }
5298 }
5299 GEOSGeom_destroy(edgeg);
5301 }
5302
5303 return 0;
5304}
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.
int lwline_is_closed(const LWLINE *line)
int ptarray_isccw(const POINTARRAY *pa)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_GEOM
#define PGTOPO_BE_ERROR()
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.
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
LWT_ISO_EDGE * lwt_be_getEdgeWithinBox2D(const LWT_TOPOLOGY *topo, const GBOX *box, uint64_t *numelems, int fields, uint64_t limit)
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)