Changes between Version 8 and Version 9 of FAQRaster
- Timestamp:
- Dec 12, 2007, 7:46:10 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FAQRaster
v8 v9 35 35 For 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 36 37 Here is an example of using gdal_translate on NAIP orthophotography in sid format to select a geotiffof Blakely Island, WA:37 Here is an example of using gdal_translate on NAIP orthophotography in sid format to select a small subwindow that shows of Blakely Island, WA: 38 38 {{{ 39 gdal_translate -of G tiff -projwin 510286 5385025 518708 5373405 ortho_1-1_1n_s_wa055_2006_1.sid naip_ortho_blakely_island.tiff39 gdal_translate -of GTiff -co TFW=YES -co INTERLEAVE=BAND -projwin 510286 5385025 518708 5373405 ortho_1-1_1n_s_wa055_2006_1.sid naip_ortho_blakely_island.tif 40 40 }}} 41 41 42 This 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.42 This example uses the -projwin option which accepts the bounding coordinates in the projected coordinates 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. The naip imagery in this example is in NAD 83 Utm 10, so to get these bounding coordinates I simply loaded up the index shapefile that comes packaged with naip imagery in Quantum GIS and read the screen coordinates to form my extent. 43 43 44 44 If 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 45 46 Also, this example uses the optional -co switch to use name=value tages for a given format. For Geotiff many are available [http://www.gdal.org/frmt_gtiff.html] and in this example allowed the generation of a world file and band interleaving.