1351 GEOSGeometry *geosgeom, *geosresult;
1352 LWGEOM *igeom = NULL, *linear_geom = NULL;
1355 geom = PG_GETARG_GSERIALIZED_P(0);
1366 PG_RETURN_POINTER(result);
1374 PG_FREE_IF_COPY(geom, 0);
1377 if (linear_geom == NULL)
1388 if ( 0 == geosgeom )
1394 geosresult = GEOSGetCentroid(geosgeom);
1396 if ( geosresult == NULL )
1398 GEOSGeom_destroy(geosgeom);
1409 GEOSGeom_destroy(geosgeom);
1410 GEOSGeom_destroy(geosresult);
1411 elog(ERROR,
"Error in GEOS-PGIS conversion");
1414 GEOSGeom_destroy(geosgeom);
1415 GEOSGeom_destroy(geosresult);
1417 PG_FREE_IF_COPY(geom, 0);
1419 PG_RETURN_POINTER(result);
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
LWGEOM * lwgeom_stroke(const LWGEOM *geom, uint32_t perQuad)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_has_m(const GSERIALIZED *gser)
Check if a GSERIALIZED has an M ordinate.
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
LWPOINT * lwpoint_construct_empty(int srid, char hasz, char hasm)
int gserialized_has_z(const GSERIALIZED *gser)
Check if a GSERIALIZED has a Z ordinate.
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
void lwgeom_geos_error(const char *fmt,...)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
GSERIALIZED * GEOS2POSTGIS(GEOSGeom geom, char want3d)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
#define HANDLE_GEOS_ERROR(label)
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...