Child pages
  • Chapter 6: Tips and tricks in configuring Delft-FIAT
Skip to end of metadata
Go to start of metadata

One of the major tasks in flood impact modelling is the acquisition and processing of object data in order to calculate damages, affected units or casualties.

 

Delft-FIAT does not come with an extensive GIS-package to manage this data processing, as each modeller will have its own comfortable choice in GIS-software. Delft-FIAT ships however with some help, providing highly efficient GDAL commands and non-tested python scripts for the most common conversions from vector to rasters, mainly useful for large areas.

 

The most common vector-to-raster conversions are point-to-raster, line-to-raster and polygon-to-raster conversions. Further, some raster optimization procedures are provided.

6.1       Point-to-raster

 

With a proper GDAL installation in a command line window (see http://www.gdal.org/index.html) the following command is of use when just simply burning values in a grid (the values after a command argument preceded with a – can be adjusted) based on the locations of the points:

 

gdal_rasterize –burn 25 –init 0 –a_srs EPSG:28992 –te 0 300000 280000 625000 –tr 5 5 –ot Byte input.shp output.tif

 

Instead of using the –burn argument, one can use the –a argument to use a attribute column in the shapefile for burning the values.

 

With this command, one can easily fullfill the most basic requirements of Delft-FIAT to its geographical input data:

- identical coordinate reference system with -a_srs[1];

- an identical extent and origin with –te;

- an identical cell size with –tr.

 

The full range of possibilities can be found here: http://www.gdal.org/gdal_rasterize.html

 

For a little more possibilities, one may use the osgeo library in python. As such, a modeller gets full control on the properties of the in- and output; e.g. think of use of multiple attributes from one shape to a set of tiffs, use of formulas in value calculation, as well as adding values when two points are in the same gridcell. A specific example is provided on the wiki as: <punten_inwoners_alle.py>

6.2       Line-to-raster

 

In order to calculate the exact length of a line segment per grid cell in a very effective way (e.g. for infrastructure), a python script is available on the wiki as: <line2grid.py>

 

 

6.3       Polygon-to-raster

 

Polygon conversions to raster are most complex and can be very time-consuming pre-processing task, certainly when areas are large and expected precision is high. For example, the exact calculation of area of a polygon shapefile in a high resolution grid is not optimized yet.

 

One way to circumvent this, but without precise solution is to execute a gdal_rasterize command on a higher raster resolution (e.g. 5m) than needed, and subsequently aggregate the values to lower resolutions (make use of <abc.py> available from the wiki), or just use gdal_rasterize on resolution you want.

6.4       General comments

 

Four other standard GDAL commands have proven to be very useful in pre-processing.

6.4.1       gdal_translate to compress large tiffs significantly

 

gdal_translate -a_srs EPSG:28992 -a_nodata 0 -co "COMPRESS=LZW" input.tif output.tif

6.4.2       gdalwarp to adjust origin and extent and to compress large tiffs significantly

 

gdalwarp -t_srs EPSG:28992 -te 0 300000 300000 625000 -tr 5 5 -co "COMPRESS=LZW" input.tif output.tif

6.4.3       gdal_translate and gdaladdo to optimize viewing performance of large geotiffs

 

gdal_translate -of GTiff -co "TILED=YES" input.tif output.tif

gdaladdo -r average output.tif 2 4 8 16 32 64 128 256

6.4.4       ogr2ogr to reproject one shapefile to the other

 

ogr2ogr -t_srs some_shapefile.prj output_vector.shp input_vector.shp



[1] Note the options using a .prj file for setting your coordinate system and projection

  • No labels