First read the number of points, then read the points.
352 uint32_t npoints = 0;
360 if (npoints > maxpoints)
363 lwerror(
"Pointarray length (%d) is too large", npoints);
367 LWDEBUGF(4,
"Pointarray has %d points", npoints);
369 if(
s->has_z ) ndims++;
370 if(
s->has_m ) ndims++;
383 if( !
s->swap_bytes )
395 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 LW_TRUE
Return types for functions with status returns.
#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