Changes between Version 7 and Version 8 of FAQRaster


Ignore:
Timestamp:
Dec 12, 2007, 12:03:10 PM (16 years ago)
Author:
springmeyer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FAQRaster

    v7 v8  
    2828
    2929Examples of other tools: [http://www.osgeo.org/qgis/ Quantum GIS], [http://www.osgeo.org/grass/ GRASS], [http://www.osgeo.org/mapserver/ MapServer], [http://gmt.soest.hawaii.edu/ GMT], [http://www.saga-gis.uni-goettingen.de/ SAGA GIS].
     30
     31== How do I use gdal_translate to extract or clip a sub-section of a raster? ==
     32
     33Gdal_translate is designed to convert to and from a variety of raster formats, but it can also perform helpful geoprocessing operations during conversion.
     34
     35For example, if you would like to extract a sub-section of a raster you can use the -srcwin or -projwin options. In gdal terminology these are "subsetting" operations that allow you to select a "subwindow" to copy from the source dataset into the destination dataset. Currently, clipping raster images using vector extent polygons is not supported but is under discussion (see [http://trac.osgeo.org/gdal/ticket/1599])
     36
     37Here is an example of using gdal_translate on NAIP orthophotography in sid format to select a geotiff of Blakely Island, WA:
     38{{{
     39gdal_translate -of Gtiff -projwin 510286 5385025 518708 5373405 ortho_1-1_1n_s_wa055_2006_1.sid naip_ortho_blakely_island.tiff
     40}}}
     41
     42This example uses the -projwin option which needs the bounding coordinate in the map projection rather than in pixels (-srcwin).  Gdal_translate -projwin needs the upper left x coordinate, the upper left y coordinate, the lower right x coordinate, and the lower right y coordinate. This naip imagery is in NAD 83 Utm 10, so to get these bounding coordinates simply load up the index shapefile that comes packages with naip imagery in Quantum GIS and read the screen coordinates you'd like to clip by.
     43
     44If you don't care what section you want to clip out but just want to preview a portion of the raster use gdalinfo to get the bounding/corner coordinates and select an arbitrary subset that fits within those extents.
     45