655 GEOSGeometry *g1, *g3;
661 geom1 = PG_GETARG_GSERIALIZED_P(0);
665 PG_RETURN_POINTER(geom1);
671 lwpgerror(
"POSTGIS2GEOS: unable to deserialize input");
681 PG_RETURN_POINTER(result);
695 g3 = (GEOSGeometry *)GEOSBoundary(g1);
699 GEOSGeom_destroy(g1);
704 POSTGIS_DEBUGF(3,
"result: %s", GEOSGeomToWKT(g3));
706 GEOSSetSRID(g3, srid);
712 GEOSGeom_destroy(g1);
714 GEOSGeom_destroy(g3);
715 elog(NOTICE,
"GEOS2POSTGIS threw an error (result postgis geometry formation)!");
719 GEOSGeom_destroy(g1);
720 GEOSGeom_destroy(g3);
722 PG_FREE_IF_COPY(geom1, 0);
724 PG_RETURN_POINTER(result);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
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,...)
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, int autofix)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
GSERIALIZED * GEOS2POSTGIS(GEOSGeom geom, char want3d)
#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)...