PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ GEOS2POSTGIS()

GSERIALIZED* GEOS2POSTGIS ( GEOSGeom  geom,
char  want3d 
)

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

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

Referenced by boundary(), buffer(), clusterintersecting_garray(), GEOSnoop(), pgis_union_geometry_array(), polygonize_garray(), ST_MinimumClearanceLine(), ST_OrientedEnvelope(), and topologypreservesimplify().

2632 {
2633  LWGEOM *lwgeom;
2634  GSERIALIZED *result;
2635 
2636  lwgeom = GEOS2LWGEOM(geom, want3d);
2637  if ( ! lwgeom )
2638  {
2639  lwpgerror("%s: GEOS2LWGEOM returned NULL", __func__);
2640  return NULL;
2641  }
2642 
2643  POSTGIS_DEBUGF(4, "%s: GEOS2LWGEOM returned a %s", __func__, lwgeom_summary(lwgeom, 0));
2644 
2645  if (lwgeom_needs_bbox(lwgeom)) lwgeom_add_bbox(lwgeom);
2646 
2647  result = geometry_serialize(lwgeom);
2648  lwgeom_free(lwgeom);
2649 
2650  return result;
2651 }
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, uint8_t want3d)
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:686
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:1197
Here is the call graph for this function:
Here is the caller graph for this function: