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 502 of file lwin_wkb.c.
References wkb_parse_state::check, wkb_parse_state::has_m, wkb_parse_state::has_z, integer_from_wkb_state(), LW_FAILURE, LW_PARSER_CHECK_CLOSURE, LW_PARSER_CHECK_MINPOINTS, LWDEBUG, LWDEBUGF, lwerror(), lwpoly_add_ring(), lwpoly_construct_empty(), wkb_parse_state::lwtype, lwtype_name(), POINTARRAY::npoints, ptarray_from_wkb_state(), ptarray_is_closed_2d(), and wkb_parse_state::srid.
Referenced by lwgeom_from_wkb_state().
508 LWDEBUGF(4,
"Polygon has %d rings", nrings);
514 for( i = 0; i < nrings; i++ )
539 LWDEBUG(2,
"Unable to add ring to polygon");
540 lwerror(
"Unable to add ring to polygon");
static POINTARRAY * ptarray_from_wkb_state(wkb_parse_state *s)
POINTARRAY Read a dynamically sized point array and advance the parse state forward.
static uint32_t integer_from_wkb_state(wkb_parse_state *s)
Int32 Read 4-byte integer and advance the parse state forward.
#define LW_PARSER_CHECK_MINPOINTS
Parser check flags.
#define LWDEBUG(level, msg)
int ptarray_is_closed_2d(const POINTARRAY *pa)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
int lwpoly_add_ring(LWPOLY *poly, POINTARRAY *pa)
Add a ring, allocating extra space if necessary.
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
#define LW_PARSER_CHECK_CLOSURE