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: total jam with GDAL 2.4.1, was OK in 2.2.3 #1987

Closed
jratike80 opened this issue Nov 6, 2019 · 1 comment
Closed

gdal_contour: total jam with GDAL 2.4.1, was OK in 2.2.3 #1987

jratike80 opened this issue Nov 6, 2019 · 1 comment
Milestone

Comments

@jratike80
Copy link
Collaborator

jratike80 commented Nov 6, 2019

Gdal_contour fails with Float32 GeoTIFF http://latuviitta.org/downloads/461864267output_la.tif with GDAL versions 2.4.1 and 3.1.0dev. On Windows the task just seems to stop at 0%. On Linux this error is observed:
0ERROR 1: std::bad_alloc

With GDAL 2.2.3 on Windows the process runs fine in a few seconds.

Command to use for testing:

gdal_contour 461864267output_la.tif -f GPKG output_contour.gpkg -i 0.1

The source tiff has NoData Value=3.40282346600000016e+38 but running the command with option -snodata 3.40282346600000016e+38 does not change the situation. I believe that GDAL does not get the nodata right but starts to generate huge amount of contours. That would explain why command with fixed levels works well.

gdal_contour 461864267output_la.tif -f GPKG output_contour.gpkg -fl 0.0 0.1 0.2

Also, I am not sure if gdal_contour is supposed to work with a combination of "fixed levels" and "output as polygons" but on one Ubuntu machine it was leading to "core dumped". Another Ubuntu just aborted without dumping.

$ gdalinfo --version
GDAL 2.4.3, released 2019/10/28
$ time gdal_contour 461864267output_la.tif /home/ubuntu/output_contour.shp -fl 0.1 0.2 -p
0...10...20...30...40...50...60...70...80...90...100 - done.
gdal_contour: marching_squares/polygon_ring_appender.h:65: bool
marching_squares::PolygonRingAppender<PolygonWriter>::Ring::isIn(const
marching_squares::PolygonRingAppender<PolygonWriter>::Ring&) const 
[with PolygonWriter = PolygonContourWriter]:
Assertion `other.points.size() >= 4' failed.
Aborted (core dumped)

There may also be a connection with #1970

@rouault
Copy link
Member

rouault commented Nov 6, 2019

CC @mhugo

rouault added a commit that referenced this issue Nov 11, 2019
rouault added a commit that referenced this issue Nov 11, 2019
@rouault rouault added this to the 2.4.4 milestone Nov 11, 2019
rouault added a commit that referenced this issue Nov 11, 2019
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