Difference between revisions of "Map Reprojection"

From GRASS-Wiki
Jump to navigation Jump to search
Line 7: Line 7:
# create a destination location in the projection and datum you want to reproject the map/image into
# create a destination location in the projection and datum you want to reproject the map/image into
# working in the destination location, use r.proj or v.proj (depending on whether the map/image is raster or vector) to reproject the map/image from the import location to the destination location.
# working in the destination location, use r.proj or v.proj (depending on whether the map/image is raster or vector) to reproject the map/image from the import location to the destination location.
If your raster data set is too big (i.e, 2 gb or so), r.proj will crash. Instead, export is as a geotif, use gdalwarp to change the project and then import the new geotif file. If you have installed gdal, you almost certainly have gdalwarp as well. Directions for gdalwarp are at http://www.remotesensing.org/gdal/gdalwarp.html. The options for gdalwarp are a bit confusing. Here is an example of projecting a geotif based on srtm elevation data to utm 37N. -t_srs is the output file projection.
gdalwarp -t_srs '+proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m +no_defs' -rcs AfricaHornElev.tif AfricaHornElev37n.tif


[[Category:FAQ]]
[[Category:FAQ]]

Revision as of 15:14, 12 December 2006

Q: How to change map/image projections, datums, etc in GRASS GIS?

A:

  1. create an import location in the projection and datum of the map/image you want to import
  2. import the map/image into the location
  3. create a destination location in the projection and datum you want to reproject the map/image into
  4. working in the destination location, use r.proj or v.proj (depending on whether the map/image is raster or vector) to reproject the map/image from the import location to the destination location.

If your raster data set is too big (i.e, 2 gb or so), r.proj will crash. Instead, export is as a geotif, use gdalwarp to change the project and then import the new geotif file. If you have installed gdal, you almost certainly have gdalwarp as well. Directions for gdalwarp are at http://www.remotesensing.org/gdal/gdalwarp.html. The options for gdalwarp are a bit confusing. Here is an example of projecting a geotif based on srtm elevation data to utm 37N. -t_srs is the output file projection.

gdalwarp -t_srs '+proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m +no_defs' -rcs AfricaHornElev.tif AfricaHornElev37n.tif