Opened 6 years ago

Last modified 15 months ago

#2402 new enhancement

v.distance in Long/Lat Locations on GRASS 7.0

Reported by: micha Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Default Version: unspecified
Keywords: Cc:
CPU: Unspecified Platform: All

Description

In stable version 6.4, when working in a Long-Lat LOCATION, v.distance returns geodesic distance on a sphere in meters (in the cases of point to point, and point to line).

In GRASS 7.0 this feature is lost, and distances are always returned in the LOCATION units (i.e. degrees in a Long-Lat LOCATION). Geodesic distance should be the preferred behavior.

Attachments (1)

vdistance_ll.diff (3.1 KB) - added by mlennert 6 years ago.
patch for enabling geodesic distances in LL-locations

Download all attachments as: .zip

Change History (18)

comment:1 Changed 6 years ago by wenzeslaus

This would be a blocker for 7.0 release unless the current (7.0's) behavior will be a default and requested requested behavior optional.

See also #2401 for 6.4.

comment:2 in reply to:  1 Changed 6 years ago by mlennert

Replying to wenzeslaus:

This would be a blocker for 7.0 release unless the current (7.0's) behavior will be a default and requested requested behavior optional.

I think that geodesic distances in LL-locations should stay the default behaviour, but even if we decide to make it optional, it still needs to be implemented [1].

Markus M: as you implemented the new version of v.distance, can you tell us quickly what needs to be done ?

Moritz

[1] https://trac.osgeo.org/grass/browser/grass/trunk/vector/v.distance/distance.c#L6

comment:3 Changed 6 years ago by mlennert

In the attached patch, I had a quick go at it, in line with the patch for grass6.

Needs testing, though.

Moritz

Changed 6 years ago by mlennert

Attachment: vdistance_ll.diff added

patch for enabling geodesic distances in LL-locations

comment:4 in reply to:  description ; Changed 6 years ago by mmetz

Replying to micha:

In stable version 6.4, when working in a Long-Lat LOCATION, v.distance returns geodesic distance on a sphere in meters (in the cases of point to point, and point to line).

In GRASS 7.0 this feature is lost, and distances are always returned in the LOCATION units (i.e. degrees in a Long-Lat LOCATION). Geodesic distance should be the preferred behavior.

Fixed for trunk in r61850.

comment:5 in reply to:  4 ; Changed 6 years ago by mlennert

Replying to mmetz:

Replying to micha:

In stable version 6.4, when working in a Long-Lat LOCATION, v.distance returns geodesic distance on a sphere in meters (in the cases of point to point, and point to line).

In GRASS 7.0 this feature is lost, and distances are always returned in the LOCATION units (i.e. degrees in a Long-Lat LOCATION). Geodesic distance should be the preferred behavior.

Fixed for trunk in r61850.

With the NC-data reprojected to EPSG 4326, I get the following now:

v.distance -p from=comm_colleges to=comm_colleges upload=dist col=dist dmin=0.0001

Finding nearest features...
 100%
 100%
from_cat|dist
1|null
2|null
3|null
[...]
55|null
56|null
57|null
58|null
 100%
58 categories - no nearest feature found

Whereas the same command in the NC-location gives me the expected list of distances.

Moritz

comment:6 in reply to:  5 ; Changed 6 years ago by mmetz

Replying to mlennert:

Replying to mmetz:

Replying to micha:

In stable version 6.4, when working in a Long-Lat LOCATION, v.distance returns geodesic distance on a sphere in meters (in the cases of point to point, and point to line).

In GRASS 7.0 this feature is lost, and distances are always returned in the LOCATION units (i.e. degrees in a Long-Lat LOCATION). Geodesic distance should be the preferred behavior.

Fixed for trunk in r61850.

With the NC-data reprojected to EPSG 4326, I get the following now:

v.distance -p from=comm_colleges to=comm_colleges upload=dist col=dist dmin=0.0001

Finding nearest features...
 100%
 100%
from_cat|dist
1|null
2|null
3|null
[...]
55|null
56|null
57|null
58|null
 100%
58 categories - no nearest feature found

Oops. Fixed in r61861.

comment:7 in reply to:  6 ; Changed 6 years ago by mlennert

Replying to mmetz:

Replying to mlennert:

Replying to mmetz:

Replying to micha:

In stable version 6.4, when working in a Long-Lat LOCATION, v.distance returns geodesic distance on a sphere in meters (in the cases of point to point, and point to line).

In GRASS 7.0 this feature is lost, and distances are always returned in the LOCATION units (i.e. degrees in a Long-Lat LOCATION). Geodesic distance should be the preferred behavior.

Fixed for trunk in r61850.

With the NC-data reprojected to EPSG 4326, I get the following now:

v.distance -p from=comm_colleges to=comm_colleges upload=dist col=dist dmin=0.0001

Finding nearest features...
 100%
 100%
from_cat|dist
1|null
2|null
3|null
[...]
55|null
56|null
57|null
58|null
 100%
58 categories - no nearest feature found

Oops. Fixed in r61861.

I just found a difference in distances calculated with grass6 and grass7 for points to areas (see explanation in #2401). Needs checking.

comment:8 in reply to:  7 Changed 6 years ago by mmetz

Replying to mlennert:

I just found a difference in distances calculated with grass6 and grass7 for points to areas (see explanation in #2401). Needs checking.

G6 and G7 produced nearly identical results after the last change to v.distance in trunk, but now (r61978) there is Vect_line_geodesic_distance() available in trunk and v.distance makes use of it (r61979). The results in latlong are now more similar to the results in the original NC projection. In particular, the larger deviations present in G6 have now disappeared in trunk.

comment:9 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:10 Changed 4 years ago by martinl

Milestone: 7.0.57.3.0

comment:11 Changed 4 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:12 Changed 2 years ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:13 Changed 2 years ago by martinl

What is status of this issue?

comment:14 Changed 2 years ago by neteler

Milestone: 7.4.17.4.2

comment:15 Changed 22 months ago by martinl

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:16 Changed 18 months ago by martinl

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:17 Changed 15 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.