PostGIS  2.5.0dev-r@@SVN_REVISION@@
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).

Definition at line 86 of file g_serialized.c.

References GSERIALIZED::data, GSERIALIZED::flags, FLAGS_GET_BBOX, gbox_serialized_size(), LWDEBUG, and LWDEBUGF.

Referenced by centroid(), CircTreePIP(), contains(), coveredby(), covers(), errorIfGeometryCollection(), geography_azimuth(), geography_centroid(), geography_distance_cache_tolerance(), geography_from_geometry(), geography_perimeter(), geography_project(), geography_segmentize(), geometry_distance_spheroid(), geometry_geometrytype(), geometry_to_path(), geometry_to_point(), geometry_to_polygon(), geos_intersects(), gserialized_peek_gbox_p(), is_point(), is_poly(), LWGEOM_addpoint(), LWGEOM_angle(), LWGEOM_collect(), LWGEOM_collect_garray(), LWGEOM_dump_rings(), LWGEOM_exteriorring_polygon(), LWGEOM_force_collection(), LWGEOM_force_multi(), lwgeom_from_gserialized(), LWGEOM_geometryn_collection(), LWGEOM_getTYPE(), LWGEOM_interiorringn_polygon(), LWGEOM_line_from_mpoint(), LWGEOM_line_interpolate_point(), LWGEOM_line_locate_point(), LWGEOM_line_substring(), LWGEOM_locate_between_m(), LWGEOM_m_point(), LWGEOM_makeline(), LWGEOM_makeline_garray(), LWGEOM_makepoly(), LWGEOM_numinteriorrings_polygon(), LWGEOM_removepoint(), LWGEOM_same(), LWGEOM_segmentize2d(), LWGEOM_SetEffectiveArea(), LWGEOM_simplify2d(), LWGEOM_to_latlon(), LWGEOM_x_point(), LWGEOM_y_point(), LWGEOM_z_point(), pgis_union_geometry_array(), polyhedralsurface_parse(), postgis_valid_typmod(), RASTER_nearestValue(), RASTER_setPixelValuesGeomval(), ST_AddMeasure(), ST_InterpolatePoint(), ST_IsCollection(), ST_LineCrossingDirection(), ST_OffsetCurve(), ST_RemoveRepeatedPoints(), test_gserialized_from_lwgeom(), tin_parse(), and triangle_parse().

87 {
88  uint32_t *ptr;
89  ptr = (uint32_t*)(s->data);
90  LWDEBUG(4,"entered");
91  if ( FLAGS_GET_BBOX(s->flags) )
92  {
93  LWDEBUGF(4,"skipping forward past bbox (%d bytes)",gbox_serialized_size(s->flags));
94  ptr += (gbox_serialized_size(s->flags) / sizeof(uint32_t));
95  }
96  return *ptr;
97 }
uint8_t data[1]
Definition: liblwgeom.h:383
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
unsigned int uint32_t
Definition: uthash.h:78
#define FLAGS_GET_BBOX(flags)
Definition: liblwgeom.h:141
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
size_t gbox_serialized_size(uint8_t flags)
Return the number of bytes necessary to hold a GBOX of this dimension in serialized form...
Definition: g_box.c:446
uint8_t flags
Definition: liblwgeom.h:382

Here is the call graph for this function: