[GRASS-dev] [grass-code I][378] v.distance: bogus distances for Lat/Lon locations

grass-codei at wald.intevation.org grass-codei at wald.intevation.org
Sun Apr 22 06:57:17 EDT 2007


code I item #378, was opened at 2007-04-22 22:57
Status: Open
Priority: 3
Submitted By: Hamish Bowman (hamish)
Assigned to: Nobody (None)
Summary: v.distance: bogus distances for Lat/Lon locations 
Issue type: module bug
Issue status: None
GRASS version: 6.2
GRASS component: vector
Operating system: all
Operating system version: 
GRASS CVS checkout date, if applies (YYMMDD): 


Initial Comment:
Hi,

v.distance in a lat/lon location gives distances in degrees, which is useless in most cases as lat and lon are not equally scaled and the result is a line at some given angle.


[v.distance/main.c line 470]
tseg = Vect_line_distance ( TPoints, FPoints->x[0], FPoints->y[0], 0, 0, 
	&tmp_tx, &tmp_ty, NULL, &tmp_dist, NULL, &tmp_talong);

>>From looking at
  lib/vector/Vlib/line.c  Vect_line_distance()
and
  lib/vector/diglib/line_dist.c  dig_distance2_point_to_line()

I take it Vect_line_distance() is assuming euclidian space.


perhaps Vect_line_distance() should be using Vect_line_geodesic_length(), or more simply G_geodesic_distance(), when (G_projection() == PROJECTION_LL) ?



thanks,
Hamish


----------------------------------------------------------------------

You can respond by visiting: 
http://wald.intevation.org/tracker/?func=detail&atid=204&aid=378&group_id=21




More information about the grass-dev mailing list