From: Paul Ramsey Date: Fri, 30 Dec 2011 13:23:23 +0000 (+0000) Subject: Stub in ST_LocateAlong and ST_LocateBetween for implementation before 2.0 X-Git-Tag: 2.0.0alpha1~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30dfb249d216235e666c81560a3234c67d0506e8;p=postgis Stub in ST_LocateAlong and ST_LocateBetween for implementation before 2.0 git-svn-id: http://svn.osgeo.org/postgis/trunk@8620 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/sqlmm.sql.in.c b/postgis/sqlmm.sql.in.c index 1aebf85e0..695f39a61 100644 --- a/postgis/sqlmm.sql.in.c +++ b/postgis/sqlmm.sql.in.c @@ -313,6 +313,31 @@ CREATE OR REPLACE FUNCTION SE_LocateAlong(geometry, float8) AS $$ SELECT SE_LocateBetween($1, $2, $2) $$ LANGUAGE 'sql' IMMUTABLE STRICT; +--- +-- Linear referencing functions (move to postgis.sql.in.c?) +--- +CREATE OR REPLACE FUNCTION ST_LocateBetween(geometry, float8, float8) + RETURNS geometry + AS 'MODULE_PATHNAME', 'LWGEOM_locate_between_m' + LANGUAGE 'C' IMMUTABLE STRICT; + +CREATE OR REPLACE FUNCTION ST_LocateAlong(geometry, float8) + RETURNS geometry + AS $$ SELECT SE_LocateBetween($1, $2, $2) $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + +-- LRS with offset parameter +CREATE OR REPLACE FUNCTION ST_LocateBetween(geometry, float8, float8, float8) + RETURNS geometry + AS 'MODULE_PATHNAME', 'LWGEOM_locate_between_m' + LANGUAGE 'C' IMMUTABLE STRICT; + +-- LRS with offset parameter +CREATE OR REPLACE FUNCTION ST_LocateAlong(geometry, float8, float8) + RETURNS geometry + AS $$ SELECT SE_LocateBetween($1, $2, $2) $$ + LANGUAGE 'sql' IMMUTABLE STRICT; + ------------------------------------------------------------------------------- diff --git a/postgis/uninstall_sqlmm.sql.in.c b/postgis/uninstall_sqlmm.sql.in.c index c3044ccd8..40523da27 100644 --- a/postgis/uninstall_sqlmm.sql.in.c +++ b/postgis/uninstall_sqlmm.sql.in.c @@ -63,6 +63,15 @@ DROP FUNCTION SE_EnvelopesIntersect(geometry,geometry); DROP FUNCTION SE_LocateAlong(geometry, float8); DROP FUNCTION SE_LocateBetween(geometry, float8, float8); +------------------------------------------------------------------------------- +-- SQL/MM LRS functions +------------------------------------------------------------------------------- + +DROP FUNCTION ST_LocateBetween(geometry, float8, float8); +DROP FUNCTION ST_LocateAlong(geometry, float8); +DROP FUNCTION ST_LocateBetween(geometry, float8, float8, float8); +DROP FUNCTION ST_LocateAlong(geometry, float8, float8); + ------------------------------------------------------------------------------- -- END -------------------------------------------------------------------------------