-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gdal_contour: min value unexpected #9705
Comments
I haven't tested it with v3.9.0 because it is not yet available at gisinternals.com. @rouault: Should this fix work for that version as well? I assume it does because it has a higher version number. But in this version it doesn't seems to work. The lowest value is no longer 0 but it is still not the correct value. This time I use these gdal_contour.exe arguments: If needed I can provide some sample data. |
from what I can see, you're not using -fl but -i, so this is a slightly different code path that might require extra adjustment as well. Please re-open a new issue with the gdal_contour command line arguments and the input dataset |
I was working on the new issue: gathering data, describing my steps when I noticed that the lowest value is set to the lowest value when calling first So I will update my workflow and create the statistics before I call gdal_contour, that seems to solve my problem. |
What is the bug?
I have a Surfer grid which I want to convert into polygons using gdal_contour.
The min value of the lowest polygon is 0 which I didn't expect. Since the max value is 107000 I expected the min value to be 101000.
In my next step, I calculate the average of the min and max values, and in this case that average is wrong.
I've attached the Surfer grid.
These are the values of the grid:
Surfer.zip
Steps to reproduce the issue
gdal_contour -p -f "ESRI Shapefile" -fl -97000 -37000 23000 83000 89000 95000 101000 107000 113650 121000 129000 137000 143000 149000 155000 215000 275000 335000 -amin Min -amax Max "Surfer.grd" "tmp3p4f4i.shp"
Versions and provenance
I tried it with GDAL 3.6.3, released 2023/03/07 on Windows and with GDAL 3.8.4, released 2024/02/08 also on Windows
Additional context
I don't have this problem with just this grid file, I experience the issue with all grid-files I convert using gdal_contour.
We now have to manually update the shapefile to fix this. This is a lot of work for us. I think I can free up some budget if needed to fix this issue.
The text was updated successfully, but these errors were encountered: