Return the list of directed edges bounding a face.
3103 uint64_t numfaceedges;
3118 if (numfaceedges == UINT64_MAX)
3123 if ( ! numfaceedges )
return 0;
3124 LWDEBUGF(1,
"lwt_GetFaceEdges: lwt_be_getEdgeByFace returned %d edges", numfaceedges);
3133 lwerror(
"Corrupted topology: unable to build geometry of face %"
3134 LWTFMT_ELEMID " from its %"PRIu64
" edges", face_id, numfaceedges);
3170 nseid = prevseid = 0;
3174 for ( i=0; i<facepoly->
nrings; ++i )
3183 while ( j < (int32_t) ring->
npoints-1 )
3185 LWDEBUGF(1,
"Looking for edge covering ring %d from vertex %d",
3195 lwerror(
"No edge (among %d) found to be defining geometry of face %"
3200 nextedge = &(edges[edgeno]);
3201 nextline = nextedge->
geom;
3204 " covers ring %d from vertex %d to %d",
3220 seid[nseid++] = nextedge->
face_left == face_id ?
3231 if ( (nseid - prevseid) > 1 )
3235 LWDEBUGF(1,
"Looking for smallest id among the %d edges "
3236 "composing ring %d", (nseid-prevseid), i);
3237 for ( j=prevseid; j<nseid; ++j )
3241 if ( ! minid ||
id < minid )
3248 " at position %d", minid, minidx);
3249 if ( minidx != prevseid )
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
void lwgeom_free(LWGEOM *geom)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
void * lwalloc(size_t size)
LWPOLY * lwgeom_as_lwpoly(const LWGEOM *lwgeom)
void lwgeom_reverse_in_place(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
#define LWT_COL_EDGE_FACE_RIGHT
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_FACE_LEFT
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_GEOM
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static int _lwt_FindNextRingEdge(const POINTARRAY *ring, int from, const LWT_ISO_EDGE *edges, int numedges)
static LWT_ISO_EDGE * lwt_be_getEdgeByFace(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields, const GBOX *box)
static void _lwt_RotateElemidArray(LWT_ELEMID *ary, int from, int to, int rotidx)
static LWGEOM * _lwt_FaceByEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edges, int numfaceedges)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
const LWT_BE_IFACE * be_iface