[QGIS-Developer] line_substring start- and end distance
Simon Gröchenig
simon.groechenig at salzburgresearch.at
Thu Mar 7 01:03:59 PST 2019
Hi all,
I have a question concerning the line_substring and recently updated
$length expressions. I have a linestring (EPSG:4326) and a relative
start- and end-offset (in %) and I want to create the sub linestring.
The start- and end distances at the line_substring expression should be
set in projection units (e.g. degrees in EPSG:4326). With the previous
behaviour of $length, I multiplied the relative offset (in %) with the
(planimetric) length to calculate those distances. See the following
example:
geom_to_wkt(line_substring( geom_from_wkt('LINESTRING(13 46, 15 46)'),
0.4* $length, 0.6* $length)) // $length => 2.0
results in
LINESTRING(13.8 46, 14.2 46)
With the latest release (3.6.0-1 und 3.4.5-1), the $length expression
correctly calculates the ellipsoidal length
(https://issues.qgis.org/issues/19355) and I cannot use the above
expression. Is there a way to use relative distances in the
line_substring function? Or is there an alternative to calculate the
planimetric length (without implementing my own function)?
Thanks for your help
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190307/6251ea31/attachment.html>
More information about the QGIS-Developer
mailing list