POINTARRAY Read a dynamically sized point array and advance the parse state forward.
First read the number of points, then read the points.
Definition at line 329 of file lwin_wkb.c.
References double_from_wkb_state(), wkb_parse_state::has_m, wkb_parse_state::has_z, integer_from_wkb_state(), LWDEBUGF, lwerror(), wkb_parse_state::pos, ptarray_construct(), ptarray_construct_copy_data(), POINTARRAY::serialized_pointlist, wkb_parse_state::swap_bytes, WKB_DOUBLE_SIZE, and wkb_parse_state_check().
Referenced by lwcircstring_from_wkb_state(), lwline_from_wkb_state(), lwpoly_from_wkb_state(), and lwtriangle_from_wkb_state().
339 if (npoints > maxpoints)
341 lwerror(
"point array length (%d) is too large");
344 LWDEBUGF(4,
"Pointarray has %d points", npoints);
346 if( s->
has_z ) ndims++;
347 if( s->
has_m ) ndims++;
370 for( i = 0; i < npoints * ndims; i++ )
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
uint8_t * serialized_pointlist
static uint32_t integer_from_wkb_state(wkb_parse_state *s)
Int32 Read 4-byte integer and advance the parse state forward.
#define WKB_DOUBLE_SIZE
Well-Known Binary (WKB) Output Variant Types.
POINTARRAY * ptarray_construct_copy_data(char hasz, char hasm, uint32_t npoints, const uint8_t *ptlist)
Construct a new POINTARRAY, copying in the data from ptlist.
static void wkb_parse_state_check(wkb_parse_state *s, size_t next)
Check that we are not about to read off the end of the WKB array.
#define LWDEBUGF(level, msg,...)
static double double_from_wkb_state(wkb_parse_state *s)
Double Read an 8-byte double and advance the parse state forward.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.