977 GEOSGeometry *g1, *g3;
981 gs1 = PG_GETARG_GSERIALIZED_P(0);
982 tolerance = PG_GETARG_FLOAT8(1);
988 PG_RETURN_POINTER(gs1);
992 lwpgerror(
"Geometry contains invalid coordinates");
1003 g3 = GEOSTopologyPreserveSimplify(g1,tolerance);
1004 GEOSGeom_destroy(g1);
1008 POSTGIS_DEBUGF(3,
"result: %s", GEOSGeomToWKT(g3));
1013 GEOSGeom_destroy(g3);
1017 elog(ERROR,
"GEOS topologypreservesimplify() threw an error (result postgis geometry formation)!");
1021 PG_FREE_IF_COPY(gs1, 0);
1022 PG_RETURN_POINTER(
result);
char result[OUT_DOUBLE_BUFFER_SIZE]
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)