Internal function declarations.
GEOMETRY Generic handling for WKB geometries.
The front of every WKB geometry (including those embedded in collections) is an endian byte, a type number and an optional srid number. We handle all those here, then pass to the appropriate handler for the specific type.
Definition at line 676 of file lwin_wkb.c.
References byte_from_wkb_state(), CIRCSTRINGTYPE, clamp_srid(), COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, getMachineEndian(), wkb_parse_state::has_srid, integer_from_wkb_state(), LINETYPE, LW_FALSE, LW_TRUE, lwcircstring_from_wkb_state(), lwcollection_from_wkb_state(), lwcurvepoly_from_wkb_state(), LWDEBUG, LWDEBUGF, lwerror(), lwline_from_wkb_state(), lwpoint_from_wkb_state(), lwpoly_from_wkb_state(), lwtriangle_from_wkb_state(), wkb_parse_state::lwtype, lwtype_from_wkb_state(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, NDR, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, wkb_parse_state::srid, wkb_parse_state::swap_bytes, TINTYPE, and TRIANGLETYPE.
Referenced by lwcollection_from_wkb_state(), lwcurvepoly_from_wkb_state(), and lwgeom_from_wkb().
678 char wkb_little_endian;
685 if( wkb_little_endian != 1 && wkb_little_endian != 0 )
687 LWDEBUG(4,
"Leaving due to bad first byte!");
688 lwerror(
"Invalid endian flag value encountered.");
696 if ( ! wkb_little_endian )
701 if ( wkb_little_endian )
707 LWDEBUGF(4,
"Got WKB type number: 0x%X", wkb_type);
int clamp_srid(int srid)
Return a valid SRID from an arbitrary integer Raises a notice if what comes out is different from wha...
static void lwtype_from_wkb_state(wkb_parse_state *s, uint32_t wkb_type)
Take in an unknown kind of wkb type number and ensure it comes out as an extended WKB type number (wi...
static LWTRIANGLE * lwtriangle_from_wkb_state(wkb_parse_state *s)
TRIANGLE Read a WKB triangle, starting just after the endian byte, type number and optional srid numb...
static LWCURVEPOLY * lwcurvepoly_from_wkb_state(wkb_parse_state *s)
CURVEPOLYTYPE.
static char byte_from_wkb_state(wkb_parse_state *s)
Byte Read a byte and advance the parse state forward.
static LWCOLLECTION * lwcollection_from_wkb_state(wkb_parse_state *s)
POLYHEDRALSURFACETYPE.
static uint32_t integer_from_wkb_state(wkb_parse_state *s)
Int32 Read 4-byte integer and advance the parse state forward.
#define LWDEBUG(level, msg)
#define POLYHEDRALSURFACETYPE
static LWPOLY * lwpoly_from_wkb_state(wkb_parse_state *s)
POLYGON Read a WKB polygon, starting just after the endian byte, type number and optional srid number...
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
static LWCIRCSTRING * lwcircstring_from_wkb_state(wkb_parse_state *s)
CIRCULARSTRING Read a WKB circularstring, starting just after the endian byte, type number and option...
#define LW_TRUE
Return types for functions with status returns.
char getMachineEndian(void)
static LWLINE * lwline_from_wkb_state(wkb_parse_state *s)
LINESTRING Read a WKB linestring, starting just after the endian byte, type number and optional srid ...
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define LWDEBUGF(level, msg,...)
static LWPOINT * lwpoint_from_wkb_state(wkb_parse_state *s)
POINT Read a WKB point, starting just after the endian byte, type number and optional srid number...
void lwerror(const char *fmt,...)
Write a notice out to the error handler.