Commit 3a0616b9 authored by Ludvik Brodl's avatar Ludvik Brodl
Browse files

Filling of nodata values for dem.tif now works as intended.

There is a bug in gdal_grid 1.11.2 that we are using that does not handle
nodata flag properly. Thus this workaround was used to set nodata properly.
parent 12f317a5
......@@ -307,13 +307,16 @@ fi
gdalwarp roofs.tif roofs_corr.tif
# interpolate raster from dem points
if [ ! -f dem.tif ]; then
grid_shape $DEM_POINTS_OUTSIDE_BUILDINGS_SHAPE dem.tif $x1 $y1 $x2 $y2 $ncells "invdistnn:radius=100:max_points=2"
gdal_fillnodata.py -md 2000 dem.tif
if [ ! -f dem_filled.tif ]; then
grid_shape $DEM_POINTS_OUTSIDE_BUILDINGS_SHAPE dem.tif $x1 $y1 $x2 $y2 $ncells "invdistnn:radius=100:max_points=2:nodata=-9999"
# Since we use a old gdal_grid that does not set nodata flag properly, we must call gdal_translate first before
# gdal_fillnodata.py can be used.
gdal_translate -a_nodata -9999 dem.tif dem_nodata_set.tif
gdal_fillnodata.py -md 2000 dem_nodata_set.tif dem_filled.tif
fi
# fix for bug in gdal_grid causing rasters with strange orientation, that cannot be handled by gdal_calc.py
gdalwarp dem.tif $dem
gdalwarp dem_filled.tif $dem
gdal_rasterize -te $x1 $y1 $x2 $y2 -ts $ncells $ncells -init 0 -burn 1 -a_nodata -9999 -l buildings db.sqlite building_mask.tif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment