Bug report #19756
the line_interpolate_point function does not work with EPSG 4326
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Expressions | ||
Affected QGIS version: | 3.3(master) | Regression?: | No |
Operating System: | win 10 64b OSGEO4W | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | invalid |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 27581 |
Description
I attach a shapefile linestring in EPSG 4326 and I ask you to do the
following test:
add a text field - long 80 - and populate it with the following
expression:
geom_to_wkt (line_interpolate_point ($ geometry, $ length / 2))
then exported to csv to verify the points.
result: point on the first vertex
expected result: central point along the line
In QGIS 2.18.23 LTR the field is filled out but the coordinates are of the first one
vertex and not the expected one of the centroid along the line;
In QGIS 3.2.2 the field is filled out but the coordinates are of the first one
vertex and not the expected one of the centroid along the line;
In QGIS 3.3 dev the field is NOT compiled, or rather the value is NULL
in all three versions the expression works well if used for
thematize with geometry generator
History
#1 Updated by Giovanni Manghi over 6 years ago
- Category changed from Field calculator to Expressions
#2 Updated by Nyall Dawson over 6 years ago
- Status changed from Open to Feedback
Try
line_interpolate_point ($ geometry, length($geometry) / 2)
$length converts to the project length setting, which is likely metres.
#3 Updated by salvatore fiandaca over 6 years ago
Nyall Dawson wrote:
Try
line_interpolate_point ($ geometry, length($geometry) / 2)
$length converts to the project length setting, which is likely metres.
I did a test and your expression works.
PS: in QGIS 2.18.23 changing units of measure (project properties -> degree map unit) $ length respects the change; QGIS 3.2.2 and DEV do not respect the change of units and the length is always in meters
#4 Updated by salvatore fiandaca over 6 years ago
salvatore fiandaca wrote:
Nyall Dawson wrote:
Try
line_interpolate_point ($ geometry, length($geometry) / 2)
$length converts to the project length setting, which is likely metres.
I did a test and your expression works.
errata corrige: it is necessary to change both ellipsoid settings in 'none / planimetric' and units of distance measurement in 'degrees'
thank you
PS: in QGIS 2.18.23 changing units of measure (project properties -> degree map unit) $ length respects the change; QGIS 3.2.2 and DEV do not respect the change of units and the length is always in meters
#5 Updated by Giovanni Manghi over 6 years ago
PS: in QGIS 2.18.23 changing units of measure (project properties -> degree map unit) $ length respects the change; QGIS 3.2.2 and DEV do not respect the change of units and the length is always in meters
filing a different ticket?
#6 Updated by Giovanni Manghi over 6 years ago
errata corrige: it is necessary to change both ellipsoid settings in 'none / planimetric' and units of distance measurement in 'degrees'
thank you
so... means this ticket can be closed?
#7 Updated by salvatore fiandaca over 6 years ago
Giovanni Manghi wrote:
errata corrige: it is necessary to change both ellipsoid settings in 'none / planimetric' and units of distance measurement in 'degrees'
thank youso... means this ticket can be closed?
yes, it can be closed
thank you
#8 Updated by Nyall Dawson over 6 years ago
- Resolution set to invalid
- Status changed from Feedback to Closed