POINT Read a WKB point, starting just after the endian byte, type number and optional srid number.
Advance the parse state forward appropriately. WKB point has just a set of doubles, with the quantity depending on the dimension of the point, so this looks like a special case of the above with only one point.
Definition at line 388 of file lwin_wkb.c.
References double_from_wkb_state(), getPoint2d_cp(), wkb_parse_state::has_m, wkb_parse_state::has_z, lwpoint_construct(), lwpoint_construct_empty(), wkb_parse_state::pos, ptarray_construct(), ptarray_construct_copy_data(), ptarray_free(), POINTARRAY::serialized_pointlist, wkb_parse_state::srid, wkb_parse_state::swap_bytes, WKB_DOUBLE_SIZE, wkb_parse_state_check(), POINT2D::x, and POINT2D::y.
Referenced by lwgeom_from_wkb_state().
397 if( s->
has_z ) ndims++;
398 if( s->
has_m ) ndims++;
417 for( i = 0; i < ndims; i++ )
425 if ( isnan(pt->
x) && isnan(pt->
y) )
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
void ptarray_free(POINTARRAY *pa)
#define WKB_DOUBLE_SIZE
Well-Known Binary (WKB) Output Variant Types.
LWPOINT * lwpoint_construct_empty(int srid, char hasz, char hasm)
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
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.
LWPOINT * lwpoint_construct(int srid, GBOX *bbox, POINTARRAY *point)
static double double_from_wkb_state(wkb_parse_state *s)
Double Read an 8-byte double and advance the parse state forward.