PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ gserialized_get_type()

uint32_t gserialized_get_type ( const GSERIALIZED g)

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_covers(), 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_cmp(), gserialized_peek_gbox_p(), is_point(), is_poly(), LWGEOM_addpoint(), 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  assert(s);
90  ptr = (uint32_t*)(s->data);
91  LWDEBUG(4,"entered");
92  if ( FLAGS_GET_BBOX(s->flags) )
93  {
94  LWDEBUGF(4,"skipping forward past bbox (%d bytes)",gbox_serialized_size(s->flags));
95  ptr += (gbox_serialized_size(s->flags) / sizeof(uint32_t));
96  }
97  return *ptr;
98 }
#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:142
char * s
Definition: cu_in_wkt.c:23
#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:451
Here is the call graph for this function: