A solution? (including resolution) - Re: [GRASS-user] Re: Help: Converting a raster map between locations (from wgs84 lat / long to UTM)

Corrado ct529 at york.ac.uk
Mon Nov 3 07:10:20 EST 2008


Dear friends,

this is what I have done:

1) created a location test12, coordinate system “latitude – longitude”, wgs84 
datum, default datum transformation parameters (1), region 90N,60S 
(=-60) ,180W (=-180),180E, resolution 30 seconds (=0.00833333 degrees) on 
both the X and y axis.

2) imported the file: r.in.bin -s bytes=2 input=prec/prec_4.bil north=90N 
south=60S west=180W east=180E output=dummy01 rows=18000 cols=43200 
anull=-9999

3) selected the region of interest: g.region n=64N s=49N w=10W e=2E 

4) calculated the width of the 30 seconds raster pixel, using the command 
g.region -m:

<snippet>
n=64
s=49
w=-10
e=2
nsres=927.90359439
ewres=508.14568663
rows=1800
cols=1440
</snippet>

5) created the region box, using the command:

v.in.region output=region_box 

6) created a new location, test13, using UTM, osgb36 datum, (1) datum 
transformation parameters (5 m resolution), zone 30, region 1300000 
(N),-200000 (S), -800000(W),800000(E), resolution 1 m.

7) loaded the region box: 

v.proj input=region_box location=test12 mapset=PERMANENT 
output=region_box_fromtest12

8) set the region to the region identified by the vector:

g.region vect=region_box_fromtest12 

9) set the resolution to the resolution calculated previously:

g.region nsres=927.90359439 ewres=508.14568663

10) project the raster file:

r.proj input=dummy01 location=test12 mapset=PERMANENT 
output=test_fromtest12_02 method=cubic

11) set the resolution I want:

g.region nsres=2000 ewres=2000

12) resample:
r.resample input=test_fromtest12_02 
output=test_fromtest12_02_resample --overwrite

What do you think?


On Saturday 01 November 2008 04:33:55 Glynn Clements wrote:
> Sebastian P. Luque wrote:
> > On an "additional" question: How do people set the resolution
> > correctly when transforming from lat/lon to meter and vice-versa?
>
> There is no "correct" resolution when re-projecting rasters; whatever
> you choose, the conversion will be "lossy" to some extent. It's just a
> question of what's adequate for your purposes.



-- 
Corrado Topi

Global Climate Change & Biodiversity Indicators
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk


More information about the grass-user mailing list