Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7102 closed defect (fixed)

gdal_proximity generates zeros on large raster files

Reported by: Even Rouault Owned by: warmerdam
Priority: normal Milestone: 2.2.3
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Reoprted as https://stackoverflow.com/questions/46814362/gdal-proximity-generates-zeros-on-large-raster-files

I have a raster (fcc.tif) of forest (value 1) and deforested pixels (value 0) with no data values (255) having a resolution of 30m for Papua New Guinea. This is a large raster with 60459 x 40811 pixels.

I try to use gdal_proximity.py (GDAL version 2.1.2) to compute the distance (in m) to the deforested pixels. I am using the following command:

gdal_proximity.py fcc.tif dist_defor.tif -values 0 -ot UInt32 -distunits GEO -use_input_nodata YES -nodata 4294967295

Computation is working fine for most of the region but produces incorrect zeros values on a large area having a kind of disk shape (marked in red on the following figure).

Distance to deforestation in Papua New Guinea: https://i.stack.imgur.com/w7zqS.jpg

In this area, deforested pixels are present, but they seem not to be taken into account for computing distances.

The raster fcc.tif is available here: https://nextcloud.fraisedesbois.net/index.php/s/pTVHRflJrL2yy4z

Change History (3)

comment:1 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 40489:

GDALComputeProximity(): fix int32 overflow when computing distances on large input datasets (fixes #7102)

comment:2 by Even Rouault, 7 years ago

In 40490:

GDALComputeProximity(): fix int32 overflow when computing distances on large input datasets (fixes #7102)

comment:3 by Even Rouault, 7 years ago

Milestone: 2.2.3
Note: See TracTickets for help on using tickets.