Geography Reference
In-Depth Information
Now what? It appears that GRASS isn't happy with the raster's north-
ern latitude value(s). Let's use gdalinfo to examine the raster so we can
determine what's going on:
GRASS 6.2.2 (world_lat_lon):~/desktop_gis_data > gdalinfo -nomd \
./ev11612_land_ocean_ice_8192.tif
Driver: GTiff/GeoTIFF
Size is 8192, 4096
Coordinate System is `'
Origin = (-180.021973,90.021973)
Pixel Size = (0.04394530,-0.04394530)
Corner Coordinates:
Upper Left (-180.0219727, 90.0219726)
Lower Left (-180.0219727, -89.9779762)
Upper Right ( 179.9779249, 90.0219726)
Lower Right ( 179.9779249, -89.9779762)
Center ( -0.0220239, 0.0219982)
Band 1 Block=8192x1 Type=Byte, ColorInterp=Red
Band 2 Block=8192x1 Type=Byte, ColorInterp=Green
Band 3 Block=8192x1 Type=Byte, ColorInterp=Blue
Band 4 Block=8192x1 Type=Byte, ColorInterp=Undefined
GRASS 6.2.2 (world_lat_lon):~/desktop_gis_data >
This provides us with a lot of detail information about the raster. For
now, we are interested in the coordinates. Notice that our image extends
beyond the bound of the world (at least as we defined it in our GRASS
location). The image appears to be shifted to the upper left. This is
because a world file specifies the position of the center of the upper-
left pixel. You can see that the shift is exactly half the pixel size of
0.04394530. So, how do we solve this problem so we can complete the
import? The answer is to simply translate the bounding rectangle so it
is correct. To do that, we will use the gdal_translate command:
GRASS 6.2.2 (world_lat_lon):~/desktop_gis_data > gdal_translate -of GTiff \
-a_ullr -180 90 180 -90 -co "COMPRESS=LZW" -a_srs EPSG:4326 \
./ev11612_land_ocean_ice_8192.tif world_mosaic.tif
Input file size is 8192, 4096
0...10...20...30...40...50...60...70...80...90...100 - done.
Using gdal_translate we translated the raster and created a new one with
the proper bounding rectangle ( -a_ullr -180 90 180 -90 ). We didn't change
the data; all we did was remove the shift because of the way world
files are designed. During the process, we specified the image should
be compressed using LZW ( -co "COMPRESS=LZW" ) and also assigned the
WGS84 projection to it ( -a_srs EPGS:4326 ). The new image is a true Geo-
TIFF. It doesn't have a world file but has the projection information
encoded in the file itself.
 
Search WWH ::




Custom Search