PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ GEOS2POSTGIS()

GSERIALIZED* GEOS2POSTGIS ( GEOSGeom  geom,
char  want3d 
)

Definition at line 2925 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(), ST_MinimumClearanceLine(), and topologypreservesimplify().

2926 {
2927  LWGEOM *lwgeom;
2928  GSERIALIZED *result;
2929 
2930  lwgeom = GEOS2LWGEOM(geom, want3d);
2931  if ( ! lwgeom )
2932  {
2933  lwpgerror("%s: GEOS2LWGEOM returned NULL", __func__);
2934  return NULL;
2935  }
2936 
2937  POSTGIS_DEBUGF(4, "%s: GEOS2LWGEOM returned a %s", __func__, lwgeom_summary(lwgeom, 0));
2938 
2939  if ( lwgeom_needs_bbox(lwgeom) == LW_TRUE )
2940  {
2941  lwgeom_add_bbox(lwgeom);
2942  }
2943 
2944  result = geometry_serialize(lwgeom);
2945  lwgeom_free(lwgeom);
2946 
2947  return result;
2948 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * geom
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:648
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
char * lwgeom_summary(const LWGEOM *lwgeom, int offset)
Definition: lwgeom_debug.c:158
int lwgeom_needs_bbox(const LWGEOM *geom)
Check whether or not a lwgeom is big enough to warrant a bounding box.
Definition: lwgeom.c:1152
Here is the call graph for this function:
Here is the caller graph for this function: