[GRASSLIST:7524] Raster world map reprojection

Mauro Lacy mauro at lacy.com.ar
Tue Jul 12 14:42:14 EDT 2005


Hello list,

After many trial and error attempts, I was able to import a whole world 
raster map into a correct region, mapset and location, and reproject it 
to another projection.

Here's how I did it. I don't know if it's the right way to do it, and I 
also have some questions:

1) I Resized the map to a number of pixels that horizontally matches the 
circumference of the equator (in 10kilometers/pixel "scale")
2) Defined a location with the original map projection(not an xy 
unprojected location, but a location with a defined projection)
3) Defined the unit to be "decikilometers", and the unit relation to 
meters to be 10000.
3) defined the region to be:
  north edge:0
  south edge: -2938 (number of vert.pixels. This depends on the original 
map projection)
  east edge: 0
  west edge: -4007 (number of horiz pixels)
4) imported the map using r.in.gdal, with override projection(use 
location's projection)

I don't understand why a region defined in so a counter-intuitive way 
seems to be ok. Defining the region in other ways, caused the map to be 
imported in other area/region setting than the "world" region.

I suppose that the right method to import a raster map without 
geolocation information is to import it in an unprojected location and 
geolocate it, but I don't see why I can't import it in a location with a 
defined projection in order to geolocate it. Maybe somebody can point 
out the difference.

Later, to reproject the map:
1) defined a new location for the target projection.
2) defined a "whole  world" region, in a similar manner that in the 
previous location(but with different extents, due to the different 
projection)
3) reproject it with r.proj.

Now the curious part: using this method r.proj only reprojects the 
up-right map quadrant(!)
The region seems to be correctly defined, as I can display the whole 
world extents in both projections, but after the reprojection only the 
up-right quadrant is correctly re-projected. The rest of the quadrants 
are blank.

What I'm doing wrong?

Btw, what I did to be able to reproject all the map using this method, 
was to switch the different quadrants using gimp, putting each one in 
the up-right position each time(uggh, that's not a very nice way to do a 
reprojection :)

Another curious thing was that I needed to vertically "flip" the two up 
quadrants.
It seems that the up-right quadrant of the first location was the bottom 
left quadrant of the second one, and so the original region was out of 
bounds most of the time.
Is this due to different region definition "styles", in relation to the 
chosen location's projection?
I was re-projecting from Miller Cylindrical to Equidistant Cylindrical.

Can someone please explain what I'm doing wrong, and what's the right 
way to do a  "whole world" import / reprojection / region setting?

Best regards,

Mauro




More information about the grass-user mailing list