[GRASSLIST:3931] Decimal degree support for Lat Lon
Gordon Keith
gordon.keith at csiro.au
Thu Jul 15 20:14:48 EDT 2004
We work almost exclusively in decimal degrees latitude and longitude, although
there is some occassions where decimal minutes are required (when working
with marine crew on the ship). We never work with seconds.
Grass defaults to formatting Latitude and Longitude in decimal seconds.
To get decimal degrees out of grass I have made the following changes to lib/
gis/wind_format.c:
7c7
< if (projection == PROJECTION_LL)
---
> if (projection == PROJECTION_LL && ! G__getenv("LL_DECIMAL"))
17c17
< if (projection == PROJECTION_LL)
---
> if (projection == PROJECTION_LL && ! G__getenv("LL_DECIMAL"))
27c27
< if (projection == PROJECTION_LL)
---
> if (projection == PROJECTION_LL && ! G__getenv("LL_DECIMAL"))
So that if I:
g.gisenv set="LL_DECIMAL=true"
I then get decimal degrees. The original behaviour is maintained unless
LL_DECIMAL is explicitly set.
I'm not sure if this is particularly efficient, but it works for me.
One advantage is that site files generated with this patch are in decimal
degrees and readable by other programs.
I was wondering if this is worth including in the GRASS code base (so I don't
have to remember the patch each time I upgrade versions).
Regards
Gordon
--
Gordon Keith
Programmer/Data Analyst
Marine Acoustics
CSIRO Marine Research
http://www.marine.csiro.au
The one thing we learn from history is that we don't learn from history.
-- Albert Einstein
More information about the grass-user
mailing list