Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the line_interpolate_point function does not work with EPSG 4326 #27581

Closed
qgib opened this issue Sep 3, 2018 · 8 comments
Closed

the line_interpolate_point function does not work with EPSG 4326 #27581

qgib opened this issue Sep 3, 2018 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions

Comments

@qgib
Copy link
Contributor

qgib commented Sep 3, 2018

Author Name: salvatore fiandaca (salvatore fiandaca)
Original Redmine Issue: 19756
Affected QGIS version: 3.3(master)
Redmine category:expressions


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


@qgib
Copy link
Contributor Author

qgib commented Sep 3, 2018

Author Name: Giovanni Manghi (@gioman)


  • category_id was changed from Field calculator to Expressions

@qgib
Copy link
Contributor Author

qgib commented Sep 3, 2018

Author Name: Nyall Dawson (@nyalldawson)


Try

line_interpolate_point ($ geometry, length($geometry) / 2)

$length converts to the project length setting, which is likely metres.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2018

Author Name: salvatore fiandaca (salvatore fiandaca)


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

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2018

Author Name: salvatore fiandaca (salvatore fiandaca)


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

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2018

Author Name: Giovanni Manghi (@gioman)


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?

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2018

Author Name: Giovanni Manghi (@gioman)


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?

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2018

Author Name: salvatore fiandaca (salvatore fiandaca)


Giovanni Manghi wrote:

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?

yes, it can be closed
thank you

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2018

Author Name: Nyall Dawson (@nyalldawson)


  • resolution was changed from to invalid
  • status_id was changed from Feedback to Closed

@qgib qgib closed this as completed Sep 4, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions
Projects
None yet
Development

No branches or pull requests

1 participant