jkall / qgis-midvatten-plugin

Midvatten plugin for QGIS
23 stars 8 forks source link

section plot fails on newer postgis databases due to renamed function st_linelocatepoint #333

Closed jkall closed 3 years ago

jkall commented 3 years ago

Since postGIS 2.1 the function ST_Line_Locate_Point is renamed to ST_LineLocatePoint. (https://postgis.net/docs/ST_LineLocatePoint.html)

Proposed easy fix: Add a function wrapper in "insert_obs_points_triggers_postgis.sql". create or replace function public.ST_Line_Locate_Point (IN geom1 geometry, IN geom2 geometry) returns double precision language sql as $func$select st_linelocatepoint($1, $2)$$;

A more robust, future-proof, solution would probably be to check postGIS-version and use the relevant function call.