[gdal-dev] no such function: ST_Line_Interpolate_Point when Spatialite and GDAL are installed and quite up-to-date

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Wed Feb 3 01:56:20 PST 2021


Hi,

This is how you can test with ogrinfo if the function is available for you.
Use just any vector data source instead of "point.jml". Test data is
generated by the SQL but ogr2ogr requires some datasource (I have been
wondering if it could be dummy.dum or something like that for a dummy
format).

ogrinfo -dialect sqlite -sql "select
ST_Line_Interpolate_Point(ST_GeomFromText('LINESTRING (0 0,1 1)'), 0.1)"
point.jml
Had to open data source read-only.
INFO: Open of `point.jml'
      using driver `JML' successful.
      
Layer name: SELECT
Geometry: Unknown (any)
Feature Count: 1
Extent: (0.100000, 0.100000) - (0.100000, 0.100000)
Layer SRS WKT:
(unknown)
Geometry Column = ST_Line_Interpolate_Point(ST_GeomFromText('LINESTRING (0
0,1 1)'), 0.1)
OGRFeature(SELECT):0
  POINT (0.1 0.1)

Having high enough Spatialite version does not guarantee that
ST_Line_Interpolate_Point is available. As you can see from
http://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html that function is
based on GEOS. For getting GEOS based functions into use Spatialite must
have been compiled with GEOS, and that GEOS version must have the support.
Spatialite has functions for checking various things about GEOS. As an
example my GEOS version is

ogrinfo -dialect sqlite -sql "select geos_version()" point.jml
Had to open data source read-only.
INFO: Open of `point.jml'
      using driver `JML' successful.
        
Layer name: SELECT
Geometry: None
Feature Count: 1
Layer SRS WKT:
(unknown)
geos_version(): String (0.0)
OGRFeature(SELECT):0
  geos_version() (String) = 3.9.0-CAPI-1.14.1

-Jukka Rahkonen-



GDAL - Dev mailing list wrote
> Dear list members,
> I have been trying to use the GDAL tools from within QGIS, more
> specifically the "Points Along Lines" tool, to find the lines' midpoints
> in line shapefiles. However, regardless of which file I try, I keep
> getting this error:
> 
> 
> GDAL command output:ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(SELECT
> ST_Line_Interpolate_Point(geometry, 0.5) AS geometry,* FROM
> "myshapefile"):
> no such function: ST_Line_Interpolate_Point
> 
> 
> Searching online, the only reference to that problem is a 5 years old
> thread from this very
> list: https://lists.osgeo.org/pipermail/gdal-dev/2015-May/041800.html.
> Following it, the first obvious thing to suspect is that Spatialite is
> either missing or outdated. However, neither seem to be the case in my
> 64bits Ubuntu 18.04 system:
> 
>> sudo apt-get install -y spatialite-binReading package lists...
>> DoneBuilding dependency tree       Reading state information...
>> Donespatialite-bin is already the newest version (4.3.0-2build1).
> 
> For reference, it seems that GDAL version being used is 3.0.2 and PROJ
> version is 6.2.1:
> 
> QGIS version: 3.10.1-A CoruñaQGIS code revision: 1e6b1a3eQt version:
> 5.12.6GDAL version: 3.0.2GEOS version: 3.7.2-CAPI-1.11.2 b55d2125PROJ
> version: Rel. 6.2.1, November 1st, 2019
> 
> I am at a loss: if both GDAL and Spatialite are present in my system and
> up-to-date enough to contain "ST_Line_Interpolate_Point", how could I
> solve the mentioned issue?
> Thanks!
> Ann Tulliani
> 
> 
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list