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

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

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

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

3169 {
3170  LWGEOM *lwgeom;
3172 
3173  lwgeom = GEOS2LWGEOM(geom, want3d);
3174  if ( ! lwgeom )
3175  {
3176  lwerror("GEOS2POSTGIS: GEOS2LWGEOM returned NULL");
3177  return NULL;
3178  }
3179 
3180  POSTGIS_DEBUGF(4, "GEOS2POSTGIS: GEOS2LWGEOM returned a %s", lwgeom_summary(lwgeom, 0));
3181 
3182  if ( lwgeom_needs_bbox(lwgeom) == LW_TRUE )
3183  {
3184  lwgeom_add_bbox(lwgeom);
3185  }
3186 
3187  result = geometry_serialize(lwgeom);
3188  lwgeom_free(lwgeom);
3189 
3190  return result;
3191 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
char ** result
Definition: liblwgeom.h:218
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
LWGEOM * geom
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:555
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:1059

Here is the call graph for this function:

Here is the caller graph for this function: