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 726 of file lwin_wkb.c.
728 char wkb_little_endian;
737 if( wkb_little_endian != 1 && wkb_little_endian != 0 )
739 LWDEBUG(4,
"Leaving due to bad first byte!");
740 lwerror(
"Invalid endian flag value encountered.");
758 LWDEBUGF(4,
"Got WKB type number: 0x%X", wkb_type);
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define POLYHEDRALSURFACETYPE
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define LW_TRUE
Return types for functions with status returns.
int32_t clamp_srid(int32_t srid)
Return a valid SRID from an arbitrary integer Raises a notice if what comes out is different from wha...
#define LWDEBUG(level, msg)
#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 LWCURVEPOLY * lwcurvepoly_from_wkb_state(wkb_parse_state *s)
CURVEPOLYTYPE.
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...
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.
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 ...
static LWCOLLECTION * lwcollection_from_wkb_state(wkb_parse_state *s)
POLYHEDRALSURFACETYPE.
static char byte_from_wkb_state(wkb_parse_state *s)
Byte Read a byte and advance the parse state forward.
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...
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...
References byte_from_wkb_state(), CIRCSTRINGTYPE, clamp_srid(), COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, integer_from_wkb_state(), IS_BIG_ENDIAN, 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(), lwtype_from_wkb_state(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, s, TINTYPE, and TRIANGLETYPE.
Referenced by lwcollection_from_wkb_state(), lwcurvepoly_from_wkb_state(), and lwgeom_from_wkb().