First read the number of points, then read the points.
341{
343 size_t pa_size;
344 uint32_t ndims = 2;
345 uint32_t npoints = 0;
347
348
351 return NULL;
352 if (npoints > maxpoints)
353 {
354 lwerror(
"Pointarray length (%d) is too large");
355 return NULL;
356 }
357
358 LWDEBUGF(4,
"Pointarray has %d points", npoints);
359
360 if(
s->has_z ) ndims++;
361 if(
s->has_m ) ndims++;
363
364
365 if( npoints == 0 )
367
368
371 return NULL;
372
373
374 if( !
s->swap_bytes )
375 {
378 }
379
380 else
381 {
382 uint32_t i = 0;
383 double *dlist;
386 for( i = 0; i < npoints * ndims; i++ )
387 {
389 }
390 }
391
392 return pa;
393}
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