837 GEOSGeometry *g1, *g3;
841 gs1 = PG_GETARG_GSERIALIZED_P(0);
842 tolerance = PG_GETARG_FLOAT8(1);
848 PG_RETURN_POINTER(gs1);
852 lwpgerror(
"Geometry contains invalid coordinates");
863 g3 = GEOSTopologyPreserveSimplify(g1,tolerance);
864 GEOSGeom_destroy(g1);
868 POSTGIS_DEBUGF(3,
"result: %s", GEOSGeomToWKT(g3));
873 GEOSGeom_destroy(g3);
877 elog(ERROR,
"GEOS topologypreservesimplify() threw an error (result postgis geometry formation)!");
881 PG_FREE_IF_COPY(gs1, 0);
882 PG_RETURN_POINTER(result);
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_has_z(const GSERIALIZED *g)
Check if a GSERIALIZED has a Z ordinate.
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
void lwgeom_geos_error(const char *fmt,...)
void lwgeom_free(LWGEOM *geom)
int lwgeom_isfinite(const LWGEOM *lwgeom)
Check if a LWGEOM has any non-finite (NaN or Inf) coordinates.
#define LW_TRUE
Return types for functions with status returns.
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
#define HANDLE_GEOS_ERROR(label)
GSERIALIZED * GEOS2POSTGIS(GEOSGeom geom, char want3d)