PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwgeom_from_wkb()

LWGEOM * lwgeom_from_wkb ( const uint8_t *  wkb,
const size_t  wkb_size,
const char  check 
)
extern

WKB inputs must have a declared size, to prevent malformed WKB from reading off the end of the memory segment (this stops a malevolent user from declaring a one-ring polygon to have 10 rings, causing the WKB reader to walk off the end of the memory).

Parameters
checkparser check flags, see LW_PARSER_CHECK_* macros
sizelength of WKB byte buffer
wkbWKB byte buffer

Check is a bitmask of: LW_PARSER_CHECK_MINPOINTS, LW_PARSER_CHECK_ODD, LW_PARSER_CHECK_CLOSURE, LW_PARSER_CHECK_NONE, LW_PARSER_CHECK_ALL

Definition at line 833 of file lwin_wkb.c.

834{
836
837 /* Initialize the state appropriately */
838 s.wkb = wkb;
839 s.wkb_size = wkb_size;
840 s.swap_bytes = LW_FALSE;
841 s.check = check;
842 s.lwtype = 0;
843 s.srid = SRID_UNKNOWN;
844 s.has_z = LW_FALSE;
845 s.has_m = LW_FALSE;
846 s.has_srid = LW_FALSE;
847 s.error = LW_FALSE;
848 s.pos = wkb;
849 s.depth = 1;
850
851 if (!wkb || !wkb_size)
852 return NULL;
853
854 return lwgeom_from_wkb_state(&s);
855}
char * s
Definition cu_in_wkt.c:23
#define LW_FALSE
Definition liblwgeom.h:108
#define SRID_UNKNOWN
Unknown SRID value.
Definition liblwgeom.h:229
LWGEOM * lwgeom_from_wkb_state(wkb_parse_state *s)
Internal function declarations.
Definition lwin_wkb.c:734
const uint8_t * wkb
Definition lwin_wkb.c:41
Used for passing the parse state between the parsing functions.
Definition lwin_wkb.c:40

References LW_FALSE, lwgeom_from_wkb_state(), s, SRID_UNKNOWN, and wkb_parse_state::wkb.

Referenced by cu_wkb_in(), geography_from_binary(), geography_recv(), lwgeom_from_hexwkb(), LWGEOM_from_WKB(), LWGEOM_in(), LWGEOM_recv(), LWGEOMFromEWKB(), rt_raster_gdal_polygonize(), test_geos_makevalid(), and test_wkb_fuzz().

Here is the call graph for this function:
Here is the caller graph for this function: