PostGIS  2.5.7dev-r@@SVN_REVISION@@
g_serialized.c File Reference
#include "liblwgeom_internal.h"
#include "lwgeom_log.h"
#include "lwgeodetic.h"
Include dependency graph for g_serialized.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  floatuint


#define HAVE_PDEP   0


static uint32_t gserialized_get_uint32_t (const uint8_t *loc)
int gserialized_has_bbox (const GSERIALIZED *gser)
 Check if a GSERIALIZED has a bounding box without deserializing first. More...
int gserialized_has_z (const GSERIALIZED *gser)
 Check if a GSERIALIZED has a Z ordinate. More...
int gserialized_has_m (const GSERIALIZED *gser)
 Check if a GSERIALIZED has an M ordinate. More...
int gserialized_get_zm (const GSERIALIZED *gser)
 Return a number indicating presence of Z and M coordinates. More...
int gserialized_ndims (const GSERIALIZED *gser)
 Return the number of dimensions (2, 3, 4) in a geometry. More...
int gserialized_is_geodetic (const GSERIALIZED *gser)
 Check if a GSERIALIZED is a geography. More...
uint32_t gserialized_max_header_size (void)
 Returns the size in bytes to read from toast to get the basic information from a geometry: GSERIALIZED struct, bbox and type. More...
uint32_t gserialized_header_size (const GSERIALIZED *gser)
 Returns the size in bytes of the header, from the start of the object up to the type number. More...
uint32_t gserialized_get_type (const GSERIALIZED *s)
 Extract the geometry type from the serialized form (it hides in the anonymous data area, so this is a handy function). More...
int32_t gserialized_get_srid (const GSERIALIZED *s)
 Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function). More...
void gserialized_set_srid (GSERIALIZED *s, int32_t srid)
 Write the SRID into the serialized form (it is packed into three bytes so this is a handy function). More...
static int gserialized_cmp_srid (const GSERIALIZED *s1, const GSERIALIZED *s2)
GSERIALIZEDgserialized_copy (const GSERIALIZED *g)
 Return a copy of the input serialized geometry. More...
static size_t gserialized_is_empty_recurse (const uint8_t *p, int *isempty)
int gserialized_is_empty (const GSERIALIZED *g)
 Check if a GSERIALIZED is empty without deserializing first. More...
char * gserialized_to_string (const GSERIALIZED *g)
 Return a WKT representation of the gserialized geometry. More...
static uint64_t uint32_interleave_2 (uint32_t u1, uint32_t u2)
uint64_t gbox_get_sortable_hash (const GBOX *g)
 Return a sortable key based on the center point of the GBOX. More...
int gserialized_cmp (const GSERIALIZED *g1, const GSERIALIZED *g2)
 Return -1 if g1 is "less than" g2, 1 if g1 is "greater than" g2 and 0 if g1 and g2 are the "same". More...
int gserialized_read_gbox_p (const GSERIALIZED *g, GBOX *gbox)
 Pull a GBOX from the header of a GSERIALIZED, if one is available. More...
static int gserialized_peek_gbox_p (const GSERIALIZED *g, GBOX *gbox)
int gserialized_get_gbox_p (const GSERIALIZED *g, GBOX *box)
 Read the bounding box off a serialization and calculate one if it is not already there. More...
static size_t gserialized_from_any_size (const LWGEOM *geom)
static size_t gserialized_from_lwpoint_size (const LWPOINT *point)
static size_t gserialized_from_lwline_size (const LWLINE *line)
static size_t gserialized_from_lwtriangle_size (const LWTRIANGLE *triangle)
static size_t gserialized_from_lwpoly_size (const LWPOLY *poly)
static size_t gserialized_from_lwcircstring_size (const LWCIRCSTRING *curve)
static size_t gserialized_from_lwcollection_size (const LWCOLLECTION *col)
size_t gserialized_from_lwgeom_size (const LWGEOM *geom)
 Calculate required memory segment to contain a serialized form of the LWGEOM. More...
static size_t gserialized_from_lwgeom_any (const LWGEOM *geom, uint8_t *buf)
static size_t gserialized_from_lwpoint (const LWPOINT *point, uint8_t *buf)
static size_t gserialized_from_lwline (const LWLINE *line, uint8_t *buf)
static size_t gserialized_from_lwpoly (const LWPOLY *poly, uint8_t *buf)
static size_t gserialized_from_lwtriangle (const LWTRIANGLE *triangle, uint8_t *buf)
static size_t gserialized_from_lwcircstring (const LWCIRCSTRING *curve, uint8_t *buf)
static size_t gserialized_from_lwcollection (const LWCOLLECTION *coll, uint8_t *buf)
static size_t gserialized_from_gbox (const GBOX *gbox, uint8_t *buf)
GSERIALIZEDgserialized_from_lwgeom (LWGEOM *geom, size_t *size)
 Allocate a new GSERIALIZED from an LWGEOM. More...
static LWGEOMlwgeom_from_gserialized_buffer (uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWPOINTlwpoint_from_gserialized_buffer (uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWLINElwline_from_gserialized_buffer (uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWPOLYlwpoly_from_gserialized_buffer (uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWTRIANGLElwtriangle_from_gserialized_buffer (uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWCIRCSTRINGlwcircstring_from_gserialized_buffer (uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWCOLLECTIONlwcollection_from_gserialized_buffer (uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
LWGEOMlwgeom_from_gserialized (const GSERIALIZED *g)
 Allocate a new LWGEOM from a GSERIALIZED. More...