PostGIS  2.1.10dev-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 56 of file g_serialized.c.

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

Referenced by CircTreePIP(), contains(), coveredby(), covers(), errorIfGeometryCollection(), geography_azimuth(), 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_peek_gbox_p(), isring(), 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_removepoint(), LWGEOM_same(), LWGEOM_segmentize2d(), 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(), test_gserialized_from_lwgeom(), tin_parse(), and triangle_parse().

57 {
58  uint32_t *ptr;
59  assert(s);
60  ptr = (uint32_t*)(s->data);
61  LWDEBUG(4,"entered");
62  if ( FLAGS_GET_BBOX(s->flags) )
63  {
64  LWDEBUGF(4,"skipping forward past bbox (%d bytes)",gbox_serialized_size(s->flags));
65  ptr += (gbox_serialized_size(s->flags) / sizeof(uint32_t));
66  }
67  return *ptr;
68 }
uint8_t data[1]
Definition: liblwgeom.h:340
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
#define FLAGS_GET_BBOX(flags)
Definition: liblwgeom.h:108
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
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:375
uint8_t flags
Definition: liblwgeom.h:339

Here is the call graph for this function: