QGIS
QGIS copied to clipboard
Fix issue with vertical lines not visible in the elevation profile tool
Description
This PR reverts commit ce96dee6b517bc19a84c9394e48d6cb30e80c1f7.
This commit was introduced to gain some performance when the
tolerance
is set by using request.setDistanceWithin
instead of
request.setFilterRect
. However, in that case, the providers either
use GEOS::distance
or GEOS::distanceWithin
which is not able to
handle the Z component of a Geometry.
For example, a purely vertical line, i.e.: LineString(X Y Z1, X Y Z2)
will always be to an infinite distance of any geometry according
to GEOS.
In practice, this means that a purely vertical line will never be
visible in the elevation profile when the tolerance is set. Indeed,
the provider will always discard such geometry because of the usage
of setDistanceWithin
. This issue is fixed by always using
setFilterRect
. This might introduce a performance penalty but this
ensures that the result is always correct.