[QGIS-Developer] Geometry generator expression for line segment length

Nyall Dawson nyall.dawson at gmail.com
Sun Nov 17 19:40:20 PST 2019


On Fri, 15 Nov 2019 at 05:34, Anita Graser <anitagraser at gmx.at> wrote:
>
> Hi,
>
> I recently noticed that the expression I used in https://anitagraser.com/2016/10/09/movement-data-in-gis-2-visualization/ does not work in current QGIS versions anymore. Specifically, I computed the metric length of a line segment by transforming from WGS84 'EPSG:4326' to 'EPSG:54027':
>
> length(
>       transform(
>         geometry_n($geometry, at geometry_part_num),
>         'EPSG:4326','EPSG:54027'
>         )
>     )
>
> While debugging, I found that the transformation is not applied anymore. (Some other EPSG codes do work though.) However, I couldn't figure out how to get this transformation to work again.

Is this a proj 6 based build? In any case, EPSG:54027 doesn't exist.
The correct code is "ESRI:54027" (see https://epsg.io/54027). It's
possible that < proj 6 builds had some exception in place for this
particular CRS, but with a proj 6 based build we rely on proj to
interpret CRS auth/id pairs so any exceptions in place for earlier
QGIS versions won't apply anymore.

Nyall


More information about the QGIS-Developer mailing list