In a previous question, I discovered that ST_LocateAlong
along a LineStringM is not implemented the same way in Spatialite than in PostGIS.
While PostGIS interpolates between measures, this is not the case in Spatialite. In Spatialite, only vertices which exactly match the m-values are returned.
Example:
SELECT
ST_AsText(ST_LocateAlong(ST_GeomFromText('LINESTRINGM(0 0 1, 0 1 2, 1 1.5 3, 1 2 3.5)'), 2));
- PostGIS returns
MULTIPOINT M (0 1 2)
- Spatialite returns
POINT M(0 1 2)
Both implementations return (almost) the same result, except that PostGIS is MULTIPOINT M
instead of POINT M
.
When the measure is not on a vertex, PostGIS interpolates it while Spatialite returns NULL:
SELECT
ST_AsText(ST_LocateAlong(ST_GeomFromText('LINESTRINGM(0 0 1, 0 1 2, 1 1 3, 1 2 3.5)'), 2.5));
- PostGIS returns
MULTIPOINT M (0.5 1 2.5)
- Spatialite returns
NULL
Is there an (easy) way to emulate PostGIS's behaviour in Spatialite?