First read the number of points, then read the points.
348{
350 size_t pa_size;
351 uint32_t ndims = 2;
352 uint32_t npoints = 0;
354
355
358 return NULL;
359
360 if (npoints > maxpoints)
361 {
363 lwerror(
"Pointarray length (%d) is too large", npoints);
364 return NULL;
365 }
366
367 LWDEBUGF(4,
"Pointarray has %d points", npoints);
368
369 if(
s->has_z ) ndims++;
370 if(
s->has_m ) ndims++;
372
373
374 if( npoints == 0 )
376
377
380 return NULL;
381
382
383 if( !
s->swap_bytes )
384 {
387 }
388
389 else
390 {
391 uint32_t i = 0;
392 double *dlist;
395 for( i = 0; i < npoints * ndims; i++ )
396 {
398 }
399 }
400
401 return pa;
402}
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.
#define LW_TRUE
Return types for functions with status returns.
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 void lwerror(const char *fmt,...) __attribute__((format(printf
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