Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Using gdal_grid for spatial interpolation I have run across a problem: the nodata argument is ignored. The only solution I have found for this is to then use gdal_translate but it is rather cumbersome (see below). My bash scripting skills are very, very minimal. Can anyone suggest an improvement, like passing the outputted file directly to the next tool?

gdal_grid -zfield "D2012" \
-a invdist:power=2.0:smoothing=0.0:radius1=0.0:radius2=0.0:angle=0.0:max_points=0:min_points=0:nodata=-9999 \
-txe 647822 651672 -tye 7535500 7537800 -outsize 77 46 \
-of GTiff -ot Float64 -l probe2004_2012 probe2004_2012.shp ./Output/temp.tiff
gdal_translate -stats -a_nodata -9999 -a_srs EPSG:3006 ./Output/temp.tiff ./Output/2012_IDW_2_50.tiff
rm ./Output/temp.tiff
share|improve this question
1  
The problem still exists(5th Dec 2013, gdal 1.10.1), nodata values are set to -9999 but the metadata for the file doesn't reflect this so that the -9999 values are treated as data. –  mercergeoinfo Dec 5 '13 at 10:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.