First read the number of points, then read the points.
347 if (npoints > maxpoints)
349 lwerror(
"Pointarray length (%d) is too large");
353 LWDEBUGF(4,
"Pointarray has %d points", npoints);
355 if(
s->has_z ) ndims++;
356 if(
s->has_m ) ndims++;
367 if( !
s->swap_bytes )
379 for( i = 0; i < npoints * ndims; i++ )
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.
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...
#define WKB_DOUBLE_SIZE
Well-Known Binary (WKB) Output Variant Types.
#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 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.
static double double_from_wkb_state(wkb_parse_state *s)
Double Read an 8-byte double and advance the parse state forward.
uint8_t * serialized_pointlist