PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ wkt_parser_curvepolygon_finalize()

LWGEOM * wkt_parser_curvepolygon_finalize ( LWGEOM poly,
char *  dimensionality 
)

Definition at line 666 of file lwin_wkt.c.

667{
668 lwflags_t flags = wkt_dimensionality(dimensionality);
669 int flagdims = FLAGS_NDIMS(flags);
670 LWDEBUG(4,"entered");
671
672 /* Null input implies empty return */
673 if( ! poly )
675
676 if ( flagdims > 2 )
677 {
678 /* If the number of dimensions are not consistent, we have a problem. */
679 if( flagdims != FLAGS_NDIMS(poly->flags) )
680 {
681 lwgeom_free(poly);
683 return NULL;
684 }
685
686 /* Harmonize the flags in the sub-components with the wkt flags */
687 if( LW_FAILURE == wkt_parser_set_dims(poly, flags) )
688 {
689 lwgeom_free(poly);
691 return NULL;
692 }
693 }
694
695 return poly;
696}
#define PARSER_ERROR_MIXDIMS
Definition liblwgeom.h:2175
#define LW_FAILURE
Definition liblwgeom.h:96
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
LWCURVEPOLY * lwcurvepoly_construct_empty(int32_t srid, char hasz, char hasm)
Definition lwcurvepoly.c:35
uint16_t lwflags_t
Definition liblwgeom.h:299
#define PARSER_ERROR_OTHER
Definition liblwgeom.h:2181
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:165
LWGEOM * lwcurvepoly_as_lwgeom(const LWCURVEPOLY *obj)
Definition lwgeom.c:347
#define FLAGS_NDIMS(flags)
Definition liblwgeom.h:179
#define FLAGS_GET_M(flags)
Definition liblwgeom.h:166
#define SRID_UNKNOWN
Unknown SRID value.
Definition liblwgeom.h:215
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:101
#define SET_PARSER_ERROR(errno)
Definition lwin_wkt.c:52
static int wkt_parser_set_dims(LWGEOM *geom, lwflags_t flags)
Force the dimensionality of a geometry to match the dimensionality of a set of flags (usually derived...
Definition lwin_wkt.c:101
static lwflags_t wkt_dimensionality(char *dimensionality)
Definition lwin_wkt.c:75
lwflags_t flags
Definition liblwgeom.h:461

References LWGEOM::flags, FLAGS_GET_M, FLAGS_GET_Z, FLAGS_NDIMS, LW_FAILURE, lwcurvepoly_as_lwgeom(), lwcurvepoly_construct_empty(), LWDEBUG, lwgeom_free(), PARSER_ERROR_MIXDIMS, PARSER_ERROR_OTHER, SET_PARSER_ERROR, SRID_UNKNOWN, wkt_dimensionality(), and wkt_parser_set_dims().

Here is the call graph for this function: