[GRASS-dev] [GRASS GIS] #2401: v.distance in Long/Lat Locations

#2401: v.distance in Long/Lat Locations
-------------------------+--------------------------------------------------
Reporter: micha | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.5
Component: Vector | Version: 6.4.4
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
According to the manual, v.distance should, in a long-lat LOCATION, return
geodesic distances in meters on a sphere, rather than in degrees. This
works in the cases of point to point, and point to line.

However in the case of point to boundary the module returns distances in
degrees, and not geodesic distance.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2401&gt;
GRASS GIS <http://grass.osgeo.org>

#2401: v.distance in Long/Lat Locations
-------------------------+--------------------------------------------------
Reporter: micha | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.5
Component: Vector | Version: 6.4.4
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mlennert):

Replying to [ticket:2401 micha]:
> According to the manual, v.distance should, in a long-lat LOCATION,
return geodesic distances in meters on a sphere, rather than in degrees.
This works in the cases of point to point, and point to line.
>
> However in the case of point to boundary the module returns distances in
degrees, and not geodesic distance.

I've attached a patch that solves the issue for me, but it could do with
some more testing.

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2401#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2401: v.distance in Long/Lat Locations
--------------------------+-------------------------------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.5
Component: Vector | Version: 6.4.4
Resolution: fixed | Keywords:
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by mlennert):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:1 mlennert]:
> Replying to [ticket:2401 micha]:
> > According to the manual, v.distance should, in a long-lat LOCATION,
return geodesic distances in meters on a sphere, rather than in degrees.
This works in the cases of point to point, and point to line.
> >
> > However in the case of point to boundary the module returns distances
in degrees, and not geodesic distance.
>
> I've attached a patch that solves the issue for me, but it could do with
some more testing.
>

I've applied the patch in r61859 and r61860.

Closing this ticket.

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2401#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2401: v.distance in Long/Lat Locations
--------------------------+-------------------------------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.5
Component: Vector | Version: 6.4.4
Resolution: fixed | Keywords: v.distance
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by neteler):

  * keywords: => v.distance

Comment:

Replying to [comment:2 mlennert]:
> I've applied the patch in r61859 and r61860.
>
> Closing this ticket.

Are the results identical to that of GRASS GIS 7 latest SVN?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2401#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2401: v.distance in Long/Lat Locations
--------------------------+-------------------------------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: normal | Milestone: 6.4.5
Component: Vector | Version: 6.4.4
Resolution: | Keywords: v.distance
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by mlennert):

  * status: closed => reopened
  * resolution: fixed =>

Comment:

Replying to [comment:3 neteler]:
> Replying to [comment:2 mlennert]:
> > I've applied the patch in r61859 and r61860.
> >
> > Closing this ticket.
>
> Are the results identical to that of GRASS GIS 7 latest SVN?

For point to point and point to line they seem to be equal, but there are
differences with point to area. I'll attach a file with results of the
following command:

{{{
v.distance -p from=comm_colleges to=urbanarea upload=cat,dist
col=to_cat,dist dmin=0.0001
}}}

in grass6 and grass7.

For some points (to_cats 3,7,8,12,15,23,24,25,27,32,34,43,46,48,49,52,54),
the distances are different. However, in the grass6 version they are
similar to the distances calculated in the original NC-NAD83 projection,
whereas the grass7 version gives different results.

I don't know if this is a general bug in the distance calculations in
v.distance which is corrected in the geodesic distance of grass7, or
whether the issue is in the geodesic distance calculation in grass7. I'm
suspecting the latter, but Markus M would have to look at this.

Reopening until we know for sure.

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2401#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2401: v.distance in Long/Lat Locations
--------------------------+-------------------------------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: normal | Milestone: 6.4.5
Component: Vector | Version: 6.4.4
Resolution: | Keywords: v.distance
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by mmetz):

Replying to [comment:4 mlennert]:
> Replying to [comment:3 neteler]:
> > Replying to [comment:2 mlennert]:
> > > I've applied the patch in r61859 and r61860.
> > >
> > > Closing this ticket.
> >
> > Are the results identical to that of GRASS GIS 7 latest SVN?
>
> For point to point and point to line they seem to be equal, but there
are differences with point to area.

trunk fixed in r61943, there was an uninitialized z coordinate. There are
still two differences where G6 finds as nearest area a hole inside an area
(to_cat = null). I regard this as a bug in G6.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2401#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#2401: v.distance in Long/Lat Locations
--------------------------+-------------------------------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.5
Component: Vector | Version: 6.4.4
Resolution: fixed | Keywords: v.distance
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by mlennert):

  * status: reopened => closed
  * resolution: => fixed

Comment:

Replying to [comment:5 mmetz]:
> Replying to [comment:4 mlennert]:
> > Replying to [comment:3 neteler]:
> > > Replying to [comment:2 mlennert]:
> > > > I've applied the patch in r61859 and r61860.
> > > >
> > > > Closing this ticket.
> > >
> > > Are the results identical to that of GRASS GIS 7 latest SVN?
> >
> > For point to point and point to line they seem to be equal, but there
are differences with point to area.
>
> trunk fixed in r61943, there was an uninitialized z coordinate. There
are still two differences where G6 finds as nearest area a hole inside an
area (to_cat = null). I regard this as a bug in G6.

I agree, but it's not related to geodesic distances as the same problem
occurs in a projected location.

So, closing this bug and opening another for the hole as nearest area
(#2419).

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2401#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>