Opened 16 years ago
Last modified 5 years ago
#182 new enhancement
v.segment: offset units support
Reported by: | martinl | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 7.8.3 |
Component: | Vector | Version: | svn-trunk |
Keywords: | vector, LL | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Based on
http://lists.osgeo.org/pipermail/grass-user/2008-June/045035.html
It would be cool if v.segment could accept offsets in various units.
Martin
Change History (12)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
If it is wanted, G_distance() includes code to automatically convert map units to meters- for Lat/Lon geodesic (great circle) distance is automatically used.
lib/gis/distance.c
/** * \fn double G_distance (double e1, double n1, double e2, double n2) * * \brief Returns distance in meters. * * This routine computes the distance, in meters, from * <b>x1</b>,<b>y1</b> to <b>x2</b>,<b>y2</b>. If the projection is * latitude-longitude, this distance is measured along the geodesic. Two * routines perform geodesic distance calculations. * * \param[in] x1 * \param[in] y1 * \param[in] x2 * \param[in] y2 * \return double */
this is used by d.measure, swig/python/m.distance, ...
also check what r.buffer does, it goes to a lot of trouble with units and projections and seems to end up doing the right thing.
I think importantly for the vector modules Vect_line_length() just uses hypot(dx,dy) so will only work properly in projected locations. For Lat/Lon there is Vect_line_geodesic_length(). (and I assume area equivalents) I do not know if it is better to do if(G_projection() == PROJECTION_LL)
in each module or automatically take care of that in the library like for G_distance().
There is also the small matter of the vector library not wrapping at 180 longitude, while libgis generally does; but I won't hijack the ticket. :)
Hamish
comment:3 by , 16 years ago
"r.buffer --help":
units Units of distance options: meters,kilometers,feet,miles,nautmiles default: meters
comment:4 by , 15 years ago
Component: | default → Vector |
---|---|
CPU: | → Unspecified |
Platform: | → Unspecified |
comment:5 by , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
comment:6 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:7 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:8 by , 6 years ago
Milestone: | 7.0.7 → 7.8.0 |
---|---|
Type: | task → enhancement |
comment:12 by , 5 years ago
Milestone: | → 7.8.3 |
---|
v.to.db has code which could be used: see grass/trunk/vector/v.to.db/units.c (this file should possibly go to library level).
Markus