Skip to content

Instantly share code, notes, and snippets.

@lucasvr
Created January 10, 2018 21:23
Show Gist options
  • Save lucasvr/5b1f9148d40e3b0058d2e5a4cde644ce to your computer and use it in GitHub Desktop.
Save lucasvr/5b1f9148d40e3b0058d2e5a4cde644ce to your computer and use it in GitHub Desktop.
diff -urp postgis-orig/postgis/lwgeom_sfcgal.c postgis-svn-trunk/postgis/lwgeom_sfcgal.c
--- postgis-orig/postgis/lwgeom_sfcgal.c 2018-01-10 13:27:48.000000000 -0600
+++ postgis-svn-trunk/postgis/lwgeom_sfcgal.c 2018-01-10 14:54:24.813750897 -0600
@@ -59,6 +59,7 @@ Datum sfcgal_tesselate(PG_FUNCTION_ARGS)
Datum sfcgal_minkowski_sum(PG_FUNCTION_ARGS);
Datum sfcgal_make_solid(PG_FUNCTION_ARGS);
Datum sfcgal_is_solid(PG_FUNCTION_ARGS);
+Datum sfcgal_noop(PG_FUNCTION_ARGS);
GSERIALIZED *geometry_serialize(LWGEOM *lwgeom);
@@ -763,3 +764,29 @@ Datum sfcgal_make_solid(PG_FUNCTION_ARGS
PG_RETURN_POINTER(output);
}
+PG_FUNCTION_INFO_V1(sfcgal_noop);
+Datum sfcgal_noop(PG_FUNCTION_ARGS)
+{
+ GSERIALIZED *input;
+ LWGEOM *geom;
+ LWGEOM *result;
+
+ sfcgal_postgis_init();
+
+ input = PG_GETARG_GSERIALIZED_P(0);
+ geom = lwgeom_from_gserialized(input);
+ if (! geom)
+ {
+ elog(ERROR, "sfcgal_noop: Unable to deserialize input");
+ }
+ PG_FREE_IF_COPY(input, 0);
+
+ result = lwgeom_sfcgal_noop(geom);
+ if (! result)
+ {
+ elog(ERROR, "sfcgal_noop: Unable to deserialize lwgeom");
+ }
+
+ lwgeom_free(geom);
+ PG_RETURN_POINTER(result);
+}
diff -urp postgis-orig/postgis/postgis.sql.in postgis-svn-trunk/postgis/postgis.sql.in
--- postgis-orig/postgis/postgis.sql.in 2018-01-10 13:27:48.000000000 -0600
+++ postgis-svn-trunk/postgis/postgis.sql.in 2018-01-10 14:52:48.533754244 -0600
@@ -1538,6 +1538,13 @@ CREATE OR REPLACE FUNCTION postgis_noop(
LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL
COST 10;
+-- Availability: 2.4.3
+CREATE OR REPLACE FUNCTION postgis_geos_noop(geometry)
+ RETURNS geometry
+ AS 'MODULE_PATHNAME', 'GEOSnoop'
+ LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL
+ COST 1;
+
-- Availability: 2.3.0
CREATE OR REPLACE FUNCTION ST_Normalize(geom geometry)
RETURNS geometry
diff -urp postgis-orig/postgis/sfcgal.sql.in postgis-svn-trunk/postgis/sfcgal.sql.in
--- postgis-orig/postgis/sfcgal.sql.in 2018-01-10 13:27:48.000000000 -0600
+++ postgis-svn-trunk/postgis/sfcgal.sql.in 2018-01-10 14:53:55.503751916 -0600
@@ -28,6 +28,13 @@ CREATE OR REPLACE FUNCTION postgis_sfcga
AS 'MODULE_PATHNAME'
LANGUAGE 'c' IMMUTABLE;
+-- Availability: 2.4.3
+CREATE OR REPLACE FUNCTION postgis_sfcgal_noop(geometry)
+ RETURNS geometry
+ AS 'MODULE_PATHNAME', 'sfcgal_noop'
+ LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL
+ COST 1;
+
-- Availability: 2.1.0
CREATE OR REPLACE FUNCTION ST_3DIntersection(geom1 geometry, geom2 geometry)
RETURNS geometry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment