Conversion of lat-lon raster to UTM

Terry Duell duell at atea.mat.army.defence.gov.au
Sun Sep 20 23:54:06 EDT 1998


Ladies and Gentlemen,
Further to my recent request for help about this issue, I have had a
minor win...I have found some old code I wrote some time ago that reads
an r.out.ascii (utm) file, and writes out a 2 byte per cell binary file.
This code was used to export a heap of GRASS rasters to another gis.
The upshot of this is that with some minor mods to read a lat-lon
header, all one has to do is save out a ll raster (r.out.ascii) from the
ll location, run the conversion program to produce a binary file, and
then (in the appropriate utm location/mapset) run r.in.ll.
The binary file produced by my app is the same as would be produced by
m.dem.extract and m.rot90.
With a little bit of work the app can report the command line to use
with r.in.ll.
Now having dispensed with the preamble, comes the question/query.
It seems that GRASS can only work in lat-lon down to integer seconds of
arc. 
Is this true? 
If so it has some ramifications. Some of my lat-lon data is at 9 secs,
some 3 secs, some at 1 sec arc res. 
r.in.ll requires coordinates of the *centre* of a corner cell, and if
integer values only can be used, the coordinates will be 0.5 secs in
error.
Any advice as to how to handle this one?

(if I get this app working, the source will be available...but it is in
Fortran77, and may only work properly when compiled on an SGI
machine...but then some kind soul who has the knowhow and the time may
want to convert it into C code and maybe integrate it into GRASS so that
it is *real* easy to use!)

Cheers,
-- 
Terry Duell, Senior Mobility Engineer
Army Technology & Engineering Agency                   
Maribyrnong, Victoria, Australia
ph:61-3-93195837 fax:61-3-93195830



More information about the grass-user mailing list