[Gdal-dev] gdalwarp and NO DATA propagation

Markus Neteler neteler at itc.it
Mon Mar 13 05:40:40 EST 2006


Frank, all

I continued to play with the population data set.
I needed to extract parts of Europe from this world
map and to reproject to LCC. Doing so, I observed
an potential problem with NO DATA propagation. The
known NO DATA value get's interpolated by gdalwarp:

# original data:
gdalinfo pop2000
Driver: AIG/Arc/Info Binary Grid
...
Band 1 Block=256x4 Type=Int32, ColorInterp=Undefined
  Min=0.000 Max=159004.000
  NoData Value=-2.14748e+09


# extract and warp to LCC
 gdalwarp -co COMPRESS=DEFLATE -s_srs epsg:4326 \
          -t_srs epsg:3034 -te 3278500 831250 5067000 2427000 \
          -tr 1000 1000 -rcs pop2000 pop2000_lcc.tif


#verifiction
 gdalinfo -mm pop2000_lcc.tif
 Driver: GTiff/GeoTIFF
 Size is 1789, 1596
 Coordinate System is:
 PROJCS["ETRS89 / ETRS-LCC",
 ...
 Band 1 Block=1789x1 Type=Int32, ColorInterp=Gray
    Computed Min/Max=-2147483647.000,39776.000

-> no more no data value

I discovered it after import into GRASS where no data
was more or less impossible to re-apply:

GRASS 6.1.cvs (eu_lcc):~ > r.info -r pop2000_landscan
min=-2147483647
max=39776
GRASS 6.1.cvs (eu_lcc):~ > r.null pop2000_landscan set=-2147483647
Writing new data for [pop2000_landscan]...  100%

GRASS 6.1.cvs (eu_lcc):~ > r.info -r pop2000_landscan
min=-2147483646
max=39776
GRASS 6.1.cvs (eu_lcc):~ > r.null pop2000_landscan set=-2147483646
Writing new data for [pop2000_landscan]...  100%

GRASS 6.1.cvs (eu_lcc):~ > r.info -r pop2000_landscan
min=-2147483645
max=39776

... and so forth.

Would it be possible to let known NO DATA values automatically 
survive the gdalwarp process? I searched in the archives if this
was already asked but didn't find the answer :-)

Thanks

 Markus



More information about the Gdal-dev mailing list