Skip to content
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 -snodata value kills the command #594

Closed
ghtmtt opened this issue May 8, 2018 · 4 comments
Closed

gdal_contour -snodata value kills the command #594

ghtmtt opened this issue May 8, 2018 · 4 comments
Milestone

Comments

@ghtmtt
Copy link
Contributor

ghtmtt commented May 8, 2018

Expected behavior and actual behavior.

Using gdal_contour with -snodata flag kills the command after a while. Without this flag it works nice

Steps to reproduce the problem.

gdal_contour -b 1 -a ELEV -i 500.0 -snodata 0.0 -f "ESRI Shapefile" /home/matteo/dtm.tif "home/matteo/OUTPUT.shp"

Both with CLI and within QGIS 3.1 master

Operating system

Linux Debian SID

GDAL version and provenance

GDAL 2.2.4, released 2018/03/19

@rouault
Copy link
Member

rouault commented May 8, 2018

Please provide the dataset you use. I cannot reproduce with a dataset of mine.

@ghtmtt
Copy link
Contributor Author

ghtmtt commented May 8, 2018

@rouault
Copy link
Member

rouault commented May 8, 2018

The core issue here is the override of the nodata value with 0.0 whereas the raster has a nodata value of -3.4028234663852886e+38. So when encountering such big negative values with nodata overrideen to 0, the algorithm will try to generate billions of intermediate coutour lines
The fix will avoid such attempt and error out immediately

@ghtmtt
Copy link
Contributor Author

ghtmtt commented May 8, 2018

Thank for the super quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants