From e82101801d4b2e093df8d8c33ddbb9e0ecd43e50 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 10 Jun 2005 16:03:37 +0000 Subject: [PATCH] Renamed {GEOS,JTS}_polygonize_garray to polygonize_garray to reduce redundancies. git-svn-id: http://svn.osgeo.org/postgis/trunk@1758 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgeom_geos.c | 12 ++++++------ lwgeom/lwgeom_jts.c | 23 +++++++++-------------- lwgeom/lwgeom_nojts.c | 8 ++++---- lwgeom/lwpostgis.sql.in | 2 +- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/lwgeom/lwgeom_geos.c b/lwgeom/lwgeom_geos.c index 912fa77f1..025b3a14f 100644 --- a/lwgeom/lwgeom_geos.c +++ b/lwgeom/lwgeom_geos.c @@ -35,7 +35,7 @@ Datum GEOSnoop(PG_FUNCTION_ARGS); Datum postgis_geos_version(PG_FUNCTION_ARGS); Datum postgis_jts_version(PG_FUNCTION_ARGS); Datum centroid(PG_FUNCTION_ARGS); -Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS); +Datum polygonize_garray(PG_FUNCTION_ARGS); @@ -2418,8 +2418,8 @@ Datum GEOSnoop(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } -PG_FUNCTION_INFO_V1(GEOS_polygonize_garray); -Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS) +PG_FUNCTION_INFO_V1(polygonize_garray); +Datum polygonize_garray(PG_FUNCTION_ARGS) { Datum datum; ArrayType *array; @@ -2448,7 +2448,7 @@ Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS) nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array)); #ifdef PGIS_DEBUG - elog(NOTICE, "GEOS_polygonize_garray: number of elements: %d", nelems); + elog(NOTICE, "polygonize_garray: number of elements: %d", nelems); #endif if ( nelems == 0 ) PG_RETURN_NULL(); @@ -2479,12 +2479,12 @@ Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS) } #ifdef PGIS_DEBUG - elog(NOTICE, "GEOS_polygonize_garray: invoking GEOSpolygonize"); + elog(NOTICE, "polygonize_garray: invoking GEOSpolygonize"); #endif geos_result = GEOSpolygonize(vgeoms, nelems); #ifdef PGIS_DEBUG - elog(NOTICE, "GEOS_polygonize_garray: GEOSpolygonize returned"); + elog(NOTICE, "polygonize_garray: GEOSpolygonize returned"); #endif //pfree(vgeoms); if ( ! geos_result ) PG_RETURN_NULL(); diff --git a/lwgeom/lwgeom_jts.c b/lwgeom/lwgeom_jts.c index deba76c86..1bda6ed6c 100644 --- a/lwgeom/lwgeom_jts.c +++ b/lwgeom/lwgeom_jts.c @@ -34,7 +34,7 @@ Datum pointonsurface(PG_FUNCTION_ARGS); Datum JTSnoop(PG_FUNCTION_ARGS); Datum postgis_geos_version(PG_FUNCTION_ARGS); Datum centroid(PG_FUNCTION_ARGS); -Datum JTS_polygonize_garray(PG_FUNCTION_ARGS); +Datum polygonize_garray(PG_FUNCTION_ARGS); @@ -2483,8 +2483,8 @@ Datum JTSnoop(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } -PG_FUNCTION_INFO_V1(JTS_polygonize_garray); -Datum JTS_polygonize_garray(PG_FUNCTION_ARGS) +PG_FUNCTION_INFO_V1(polygonize_garray); +Datum polygonize_garray(PG_FUNCTION_ARGS) { Datum datum; ArrayType *array; @@ -2513,7 +2513,7 @@ Datum JTS_polygonize_garray(PG_FUNCTION_ARGS) nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array)); #ifdef PGIS_DEBUG - elog(NOTICE, "JTS_polygonize_garray: number of elements: %d", nelems); + elog(NOTICE, "polygonize_garray: number of elements: %d", nelems); #endif if ( nelems == 0 ) PG_RETURN_NULL(); @@ -2545,12 +2545,12 @@ Datum JTS_polygonize_garray(PG_FUNCTION_ARGS) } #ifdef PGIS_DEBUG - elog(NOTICE, "JTS_polygonize_garray: invoking JTSpolygonize"); + elog(NOTICE, "polygonize_garray: invoking JTSpolygonize"); #endif geos_result = JTSpolygonize(vgeoms, nelems); #ifdef PGIS_DEBUG - elog(NOTICE, "JTS_polygonize_garray: JTSpolygonize returned"); + elog(NOTICE, "polygonize_garray: JTSpolygonize returned"); #endif //pfree(vgeoms); if ( ! geos_result ) { @@ -2573,14 +2573,6 @@ Datum JTS_polygonize_garray(PG_FUNCTION_ARGS) } -Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS); -PG_FUNCTION_INFO_V1(GEOS_polygonize_garray); -Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS) -{ - elog(NOTICE, "GEOS support is disabled, use JTS_polygonize_garray instead"); - PG_RETURN_NULL(); -} - Datum GEOSnoop(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(GEOSnoop); Datum GEOSnoop(PG_FUNCTION_ARGS) @@ -2608,6 +2600,9 @@ Datum postgis_jts_version(PG_FUNCTION_ARGS) VARATT_SIZEP(result) = VARHDRSZ + strlen(ver) ; memcpy(VARDATA(result), ver, strlen(ver)); free(ver); + + finishJTS(); + PG_RETURN_POINTER(result); } diff --git a/lwgeom/lwgeom_nojts.c b/lwgeom/lwgeom_nojts.c index 1d295c221..8a6aa7101 100644 --- a/lwgeom/lwgeom_nojts.c +++ b/lwgeom/lwgeom_nojts.c @@ -197,11 +197,11 @@ Datum unite_garray(PG_FUNCTION_ARGS) PG_RETURN_NULL(); // never get here } -Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS); -PG_FUNCTION_INFO_V1(GEOS_polygonize_garray); -Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS) +Datum polygonize_garray(PG_FUNCTION_ARGS); +PG_FUNCTION_INFO_V1(polygonize_garray); +Datum polygonize_garray(PG_FUNCTION_ARGS) { - elog(ERROR,"JTS_polygonize_garray:: operation not implemented - compile PostGIS with JTS or GEOS support"); + elog(ERROR,"polygonize_garray:: operation not implemented - compile PostGIS with JTS or GEOS support"); PG_RETURN_NULL(); // never get here } diff --git a/lwgeom/lwpostgis.sql.in b/lwgeom/lwpostgis.sql.in index 27fb4829b..13de5aa89 100644 --- a/lwgeom/lwpostgis.sql.in +++ b/lwgeom/lwpostgis.sql.in @@ -1832,7 +1832,7 @@ CREATEFUNCTION MakePolygon(geometry) CREATEFUNCTION polygonize_garray (geometry[]) RETURNS geometry - AS '@MODULE_FILENAME@', 'GEOS_polygonize_garray' + AS '@MODULE_FILENAME@', 'polygonize_garray' LANGUAGE 'C' _IMMUTABLE_STRICT; CREATE AGGREGATE polygonize ( -- 2.50.0