5092{
5095 uint64_t num, i;
5097 GEOSGeometry *edgeg;
5099
5101 if (num == UINT64_MAX)
5102 {
5104 return -1;
5105 }
5106 if ( num )
5107 {
5109
5111 if ( ! edgeg )
5112 {
5115 return -1;
5116 }
5117 for (i=0; i<num; ++i)
5118 {
5121 GEOSGeometry *gg;
5122 int equals;
5124 if ( ! gg )
5125 {
5126 GEOSGeom_destroy(edgeg);
5129 return -1;
5130 }
5131 equals = GEOSEquals(gg, edgeg);
5132 GEOSGeom_destroy(gg);
5133 if ( equals == 2 )
5134 {
5135 GEOSGeom_destroy(edgeg);
5138 return -1;
5139 }
5140 if ( equals )
5141 {
5143
5144 if ( forward )
5145 {
5146
5148 {
5150 {
5151 *forward = 1;
5152 }
5153 else
5154 {
5155 *forward = 0;
5156 }
5157 }
5158 else
5159 {
5160
5161 if (
5162 memcmp(
5166 ) == 0
5167 )
5168 {
5169 *forward = 1;
5170 }
5171 else
5172 {
5173 *forward = 0;
5174 }
5175 }
5176 }
5177 GEOSGeom_destroy(edgeg);
5179 return id;
5180 }
5181 }
5182 GEOSGeom_destroy(edgeg);
5184 }
5185
5186 return 0;
5187}
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)