You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears gdal_contour behavior has changed somewhere between 3.8.4 and 3.9.0. I am generating hillshade polygons from hillshade raster images generated by gdaldem. In my application, the world is cut into tiles and it is important that the hillshade polygons match across tile boundaries. To accomplish this, the hillshade raster image for a tile overlaps with its neighbor tile images by 8 pixels to ensure continuity (that's a total of 16 overlapping pixels between any two neighbors).
This all worked fine until I upgraded to GDAL 3.9.0. The images below illustrate the differences:
Here is the output of gdal_contour with version 3.8.4 near the boundary between two tiles where tile A is north of tile B:
Tile A
Tile B
You can see that the polgons generated in the overlapping border areas between the tiles are identical
Here is the output of gdal_contour with version 3.9.0 in the same region:
Tile A
Tile B
Here Tile A polygons are different. Note that the small polygon (gold in Tile B) is generated, but is classified to a different level than in Tile B.
In the images above, the two white dots represent points along the edge between the tiles where they will eventually be cut.
Both sets of data were generated off the same two hillshade raster images:
You can see in the image above, that there is overlap between the neighboring hillshade raster images. In the picture one of the images was turned red and made slightly transparent. I have verified that the images are pixel-for-pixel equal in the overlap region.
Steps to reproduce the issue
Attached is a zip file containing a bash script, the two source hillshade raster images and the generated hillshade polygons from each GDAL version. You should be able to modify the bash script to point to where the different GDAL binary versions are located on your computer to run the script. The script also illustrates how gdal_contour is being called.
What is the bug?
It appears
gdal_contour
behavior has changed somewhere between 3.8.4 and 3.9.0. I am generating hillshade polygons from hillshade raster images generated bygdaldem
. In my application, the world is cut into tiles and it is important that the hillshade polygons match across tile boundaries. To accomplish this, the hillshade raster image for a tile overlaps with its neighbor tile images by 8 pixels to ensure continuity (that's a total of 16 overlapping pixels between any two neighbors).This all worked fine until I upgraded to GDAL 3.9.0. The images below illustrate the differences:
Here is the output of
gdal_contour
with version 3.8.4 near the boundary between two tiles where tile A is north of tile B:Tile A
Tile B
You can see that the polgons generated in the overlapping border areas between the tiles are identical
Here is the output of
gdal_contour
with version 3.9.0 in the same region:Tile A
Tile B
Here Tile A polygons are different. Note that the small polygon (gold in Tile B) is generated, but is classified to a different level than in Tile B.
In the images above, the two white dots represent points along the edge between the tiles where they will eventually be cut.
Both sets of data were generated off the same two hillshade raster images:
You can see in the image above, that there is overlap between the neighboring hillshade raster images. In the picture one of the images was turned red and made slightly transparent. I have verified that the images are pixel-for-pixel equal in the overlap region.
Steps to reproduce the issue
Attached is a zip file containing a bash script, the two source hillshade raster images and the generated hillshade polygons from each GDAL version. You should be able to modify the bash script to point to where the different GDAL binary versions are located on your computer to run the script. The script also illustrates how
gdal_contour
is being called.gdal_contour_issue.zip
Versions and provenance
Ubuntu 24.04
GDAL version 3.9.0
Additional context
No response
The text was updated successfully, but these errors were encountered: