You can study the error by making SQL queries with Spatialite-gui which has a function ST_Length with a description at https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html
return the length of c (measured in meters). If the use_ellipsoid
argument is set to TRUE the precise (but slower) length will be
computed on the Ellipsoid, otherwise will be computed on the Great
Cicle (approximative, but faster).
Examples:
- Example one, east-west oriented linestring, length one degree, located at latitude 20°N
Great circle length:
select ST_Length(ST_GeomFromText('LINESTRING (0 20,1 20)',4326),0)
104489.040752
Length along ellipsoid:
select ST_Length(ST_GeomFromText('LINESTRING (0 20,1 20)',4326),1)
104646.930934
Then the length when the linestring is projected first into EPSG:3857:
select ST_Length(ST_Transform(ST_GeomFromText('LINESTRING (0 20,1 20)',4326),3857))
111319.490793
Difference to length along ellipsoid 6673 m.
- Example two, east-west oriented linestring, length one degree, located at latitude 60°N
Great circle length:
select ST_Length(ST_GeomFromText('LINESTRING (0 60,1 60)',4326),0)
55597.010615
Length along ellipsoid:
select ST_Length(ST_GeomFromText('LINESTRING (0 60,1 60)',4326),1)
55799.470393
Then the length when the linestring is projected first into EPSG:3857:
select ST_Length(ST_Transform(ST_GeomFromText('LINESTRING (0 60,1 60)',4326),3857))
111319.490793
Difference to length along ellipsoid 55520 m.
You can do similar queries with PostGIS but you must use "geography" http://postgis.net/docs/ST_Length.html.