Difference between revisions of "Large raster data processing"

From GRASS-Wiki
Jump to navigation Jump to search
Line 8: Line 8:


  gdaltindex an_index.shp *.tif
  gdaltindex an_index.shp *.tif
This command will create a polygon shapefile with the footprint of each raster as the polygon shape and the name of the image files represented in the attribute table.  After that, we just need to do a spatial select on the shapefile and extract the filenames from the attributes from the selected polygons:
ogrinfo an_index.shp -spat xmin ymin xmax ymax
will produce a txt list, or
ogr2ogr -f CSV list.csv an_index.shp -spat xmin ymin xmax ymax
will produce a csv file.
Our area of interest has the following boundaries:
north: N71: ymax = 72.0001389
south: N34: ymin = 33.9998611
west: W011: xmin = -11.0001389
east: E042: xmax = 43.0001389

Revision as of 08:19, 19 July 2012


Create a mosaic

Suppose that we have all ASTER GDEM world coverage (>22000 files) and we aim to build a mosaic of Europe and import it in GRASS. A nice reference on how to deal with ASTER GDEM is here. The very first step is to select among the >22000 files those covering our area of interest (Europe). To this aim, we can use use gdaltindex to create an index of all the files:

gdaltindex an_index.shp *.tif

This command will create a polygon shapefile with the footprint of each raster as the polygon shape and the name of the image files represented in the attribute table. After that, we just need to do a spatial select on the shapefile and extract the filenames from the attributes from the selected polygons:

ogrinfo an_index.shp -spat xmin ymin xmax ymax

will produce a txt list, or

ogr2ogr -f CSV list.csv an_index.shp -spat xmin ymin xmax ymax

will produce a csv file.

Our area of interest has the following boundaries:

north: N71: ymax = 72.0001389 
south: N34: ymin = 33.9998611
west: W011: xmin = -11.0001389
east: E042: xmax = 43.0001389