Definition at line 585 of file lwin_wkt.c.
586{
588
589
590 if( ! (ring && poly) )
591 {
594 return NULL;
595 }
596
597
599 {
600 LWDEBUG(4,
"dimensionality does not match");
604 return NULL;
605 }
606
607
609 {
610 uint32_t vertices_needed = 3;
611
613 vertices_needed = 4;
614
616 {
617 LWDEBUG(4,
"number of points is incorrect");
621 return NULL;
622 }
623 }
624
625
627 {
628 int is_closed = 1;
629 LWDEBUG(4,
"checking ring closure");
630 switch ( ring->
type )
631 {
634 break;
635
638 break;
639
642 break;
643 }
644 if ( ! is_closed )
645 {
646 LWDEBUG(4,
"ring is not closed");
650 return NULL;
651 }
652 }
653
655 {
656 LWDEBUG(4,
"failed to add ring");
660 return NULL;
661 }
662
663 return poly;
664}
#define PARSER_ERROR_MIXDIMS
#define LW_PARSER_CHECK_CLOSURE
void lwgeom_free(LWGEOM *geom)
#define PARSER_ERROR_MOREPOINTS
#define PARSER_ERROR_OTHER
LWCURVEPOLY * lwgeom_as_lwcurvepoly(const LWGEOM *lwgeom)
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
#define FLAGS_NDIMS(flags)
LWCOMPOUND * lwgeom_as_lwcompound(const LWGEOM *lwgeom)
LWCIRCSTRING * lwgeom_as_lwcircstring(const LWGEOM *lwgeom)
int lwcurvepoly_add_ring(LWCURVEPOLY *poly, LWGEOM *ring)
Add a ring, allocating extra space if necessary.
#define LW_PARSER_CHECK_MINPOINTS
Parser check flags.
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
#define PARSER_ERROR_UNCLOSED
int lwcircstring_is_closed(const LWCIRCSTRING *curve)
int lwline_is_closed(const LWLINE *line)
int lwcompound_is_closed(const LWCOMPOUND *curve)
#define LWDEBUG(level, msg)
#define SET_PARSER_ERROR(errno)
LWGEOM_PARSER_RESULT global_parser_result
References CIRCSTRINGTYPE, COMPOUNDTYPE, LWGEOM::flags, FLAGS_NDIMS, global_parser_result, LINETYPE, LW_FAILURE, LW_PARSER_CHECK_CLOSURE, LW_PARSER_CHECK_MINPOINTS, lwcircstring_is_closed(), lwcompound_is_closed(), lwcurvepoly_add_ring(), LWDEBUG, lwgeom_as_lwcircstring(), lwgeom_as_lwcompound(), lwgeom_as_lwcurvepoly(), lwgeom_as_lwline(), lwgeom_count_vertices(), lwgeom_free(), lwline_is_closed(), struct_lwgeom_parser_result::parser_check_flags, PARSER_ERROR_MIXDIMS, PARSER_ERROR_MOREPOINTS, PARSER_ERROR_OTHER, PARSER_ERROR_UNCLOSED, SET_PARSER_ERROR, and LWGEOM::type.
Referenced by wkt_parser_curvepolygon_new().