POLYGON Read a WKB polygon, starting just after the endian byte, type number and optional srid number.
Advance the parse state forward appropriately. First read the number of rings, then read each ring (which are structured as point arrays)
Definition at line 511 of file lwin_wkb.c.
517 LWDEBUGF(4,
"Polygon has %d rings", nrings);
523 for( i = 0; i < nrings; i++ )
548 LWDEBUG(2,
"Unable to add ring to polygon");
549 lwerror(
"Unable to add ring to polygon");
#define LW_PARSER_CHECK_CLOSURE
int lwpoly_add_ring(LWPOLY *poly, POINTARRAY *pa)
Add a ring, allocating extra space if necessary.
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define LW_PARSER_CHECK_MINPOINTS
Parser check flags.
int ptarray_is_closed_2d(const POINTARRAY *pa)
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static uint32_t integer_from_wkb_state(wkb_parse_state *s)
Int32 Read 4-byte integer and advance the parse state forward.
static POINTARRAY * ptarray_from_wkb_state(wkb_parse_state *s)
POINTARRAY Read a dynamically sized point array and advance the parse state forward.
References integer_from_wkb_state(), LW_FAILURE, LW_PARSER_CHECK_CLOSURE, LW_PARSER_CHECK_MINPOINTS, LWDEBUG, LWDEBUGF, lwerror(), lwpoly_add_ring(), lwpoly_construct_empty(), lwtype_name(), POINTARRAY::npoints, ptarray_from_wkb_state(), ptarray_is_closed_2d(), and s.
Referenced by lwgeom_from_wkb_state().