Changes between Version 12 and Version 13 of FAQRaster
- Timestamp:
- Aug 23, 2008, 9:03:33 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FAQRaster
v12 v13 102 102 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. 103 103 104 Note: Currently, clipping raster images using vector extent polygons is not supported but is under discussion (see [http://trac.osgeo.org/gdal/ticket/1599]). However i sis fairly easy to get the extents of a given shapefile and convert those coordinate pairs into the format needed by gdal_translate without manually reading the extents from another application like qgis. Say you have a shapefile named `clipping_mask.shp` use ogrinfo to get the extents:104 Note: Currently, clipping raster images using vector extent polygons is not supported but is under discussion (see [http://trac.osgeo.org/gdal/ticket/1599]). However it is fairly easy to get the extents of a given shapefile and convert those coordinate pairs into the format needed by gdal_translate without manually reading the extents from another application like qgis. Say you have a shapefile named `clipping_mask.shp` use ogrinfo to get the extents: 105 105 * note the use of the pipe and grep command is optional(`| grep Extent`), but is a slick way to limit the info reported by ogrinfo to just what you need in this case 106 106