Return the geometry of a face.
2842{
2843 uint64_t numfaceedges;
2848 uint64_t i, edgeid;
2849 int fields;
2850
2851 if (faceid == 0)
2852 {
2853 lwerror(
"SQL/MM Spatial exception - universal face has no geometry");
2854 return NULL;
2855 }
2856
2857
2858 numfaceedges = 1;
2863 ;
2865 if (numfaceedges == UINT64_MAX)
2866 {
2868 return NULL;
2869 }
2870 LWDEBUGF(1,
"lwt_GetFaceGeometry: lwt_be_getEdgeByFace returned %llu edges", numfaceedges);
2871
2872 if ( numfaceedges == 0 )
2873 {
2874 i = 1;
2876 if (i == UINT64_MAX)
2877 {
2879 return NULL;
2880 }
2881 if ( i == 0 ) {
2882 lwerror(
"SQL/MM Spatial exception - non-existent face.");
2883 return NULL;
2884 }
2886 if ( i > 1 ) {
2887 lwerror(
"Corrupted topology: multiple face records have face_id=%"
2889 return NULL;
2890 }
2891
2892
2893 lwnotice(
"Corrupted topology: face %"
2897 }
2899
2902
2903 if ( ! outg )
2904 {
2905
2906
2907
2908
2909
2910 lwnotice(
"Corrupted topology: face %"
2913 faceid, edgeid);
2916 }
2917
2918 return outg;
2919}
LWPOLY * lwpoly_construct_empty(int32_t srid, char hasz, char hasm)
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
#define LWT_COL_EDGE_FACE_RIGHT
#define LWT_COL_FACE_FACE_ID
Face fields.
#define LWT_COL_EDGE_FACE_LEFT
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_GEOM
#define PGTOPO_BE_ERROR()
#define LWDEBUGF(level, msg,...)
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.
static LWT_ISO_FACE * lwt_be_getFaceById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
static LWT_ISO_EDGE * lwt_be_getEdgeByFace(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields, const GBOX *box)
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
static LWGEOM * _lwt_FaceByEdges(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edges, int numfaceedges)