PostGIS  2.2.7dev-r@@SVN_REVISION@@
GSERIALIZED* GEOS2POSTGIS ( GEOSGeom  geom,
char  want3d 
)

Definition at line 3165 of file postgis/lwgeom_geos.c.

References geometry_serialize(), GEOS2LWGEOM(), LW_TRUE, lwgeom_add_bbox(), lwgeom_free(), lwgeom_needs_bbox(), and lwgeom_summary().

Referenced by boundary(), buffer(), centroid(), clusterintersecting_garray(), GEOSnoop(), pgis_union_geometry_array(), pointonsurface(), polygonize_garray(), and topologypreservesimplify().

3166 {
3167  LWGEOM *lwgeom;
3168  GSERIALIZED *result;
3169 
3170  lwgeom = GEOS2LWGEOM(geom, want3d);
3171  if ( ! lwgeom )
3172  {
3173  lwpgerror("%s: GEOS2LWGEOM returned NULL", __func__);
3174  return NULL;
3175  }
3176 
3177  POSTGIS_DEBUGF(4, "%s: GEOS2LWGEOM returned a %s", __func__, lwgeom_summary(lwgeom, 0));
3178 
3179  if ( lwgeom_needs_bbox(lwgeom) == LW_TRUE )
3180  {
3181  lwgeom_add_bbox(lwgeom);
3182  }
3183 
3184  result = geometry_serialize(lwgeom);
3185  lwgeom_free(lwgeom);
3186 
3187  return result;
3188 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * geom
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:61
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:599
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
char * lwgeom_summary(const LWGEOM *lwgeom, int offset)
Definition: lwgeom_debug.c:145
int lwgeom_needs_bbox(const LWGEOM *geom)
Check whether or not a lwgeom is big enough to warrant a bounding box.
Definition: lwgeom.c:1103

Here is the call graph for this function:

Here is the caller graph for this function: