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
Contour Layer crashes on coastline #6182
Comments
Run the request with |
Actually it just freezes like this: |
@gsueur I can reproduce here ("Killed") with a single Copernicus file with GDAL 2.4.4, and with GDAL 3.2.0 it at least gives a better message ("GDALContourGenerate() failed: Input values and/or interval settings would lead to too many levels.") I also set inside my mapfile CONFIG "CPL_DEBUG" "ON" This error happens if you only set a single CONTOUR_INTERVAL, and not handling outer scales. Try again but replace your PROCESSING "CONTOUR_INTERVAL= ... with these 3 lines:
|
Hi Jeff,
but none of the instructions (even the geomtransform thing) seems to be the root of the problem. |
@gsueur here is a small snippet of your Copernicus EU data, with mapfile, can you try this locally on your machine? (see 'commands.txt' file for the shp2img call. Also see line#10 of the mapfile, to enable that coastline EXTENT). After you get a valid image, then add your missing additions from your other mapfile, I bet you can find what line crashes that way. https://gatewaygeomatics.com/dl/ticket-6182-contour.zip |
@gsueur but indeed, next time you can save me all that time to download the 5GB dem file, clip it with gdalwarp, create new mapfile, create commands.txt file with commands to reproduce problem.........by doing that all yourself and attaching the small .zip here to the ticket. Cheers :) |
Sorry Jeff, I didn't mean to bother you. All I was asking for was some command to help me investigate, not you to completely build a test case for me. |
what I have so far :
Can't we have a division by zero here somewhere ? |
Valgrind output : |
gdb output : And then it hangs forever. |
@gsueur so my test case crashes for you? Here I cannot reproduce on several machines and GDAL/MapServer versions, and on different operating systems. What EXTENT values are you using in my mapfile (see line#10) ? You report "If I use a single and simple PROCESSING "CONTOUR_INTERVAL=10", it hangs" <--- please see my feedback above, as your single/simple line will crash MapServer each time, and i explained above how recent GDAL versions handle the issue properly. I also updated the docs with this warning, so please avoid the single/simple line as it will overwhelm MapServer/GDAL/OGR at zoomed-out scales. I'm not upset, but please do keep in mind when reporting issues to take the time to create a small test case & attach it to your ticket report, it makes it easier for others to test your problems. :) Enjoy your Sunday. |
ah I can see your extent values used in your output....will test here with the test case but with your EXTENT values, hopefully I see a crash too, ha |
Can reproduce here. The EXTENT value (around line#10 of mapfile) to reproduce is:
and GDAL 3.2.0 gives the error:
These extents are very zoomed-out, for generating contours, I am not surprised there are problems, personally. Will try to find the correct settings to avoid this error... |
this is tricky @gsueur !! I see what you mean now about problems around scale 1/100000 I'm trying to handle it nicely through CONTOUR_INTERVAL but I keep getting "Input values and/or interval settings would lead to too many levels" |
I tend to think this is a bug now, as you said, as I can't seem to handle nicely the outer scales without GDAL/OGR returning the "too many levels" error. |
Indeed, tricky and nasty ! I don't understand why the bigger scales would return "too many levels" when it works fine at lower ones. There is maybe something happening with NODATA causing this, when most of the extent is covering with null values ? |
very nasty ha. I guess we need to look into the logic in GDALContourGenerate(), to understand this "too many levels" message. But I'm glad you reported this here (!!), as I think whatever we find will help prevent others from hitting this same wall again. |
this ? I can't really get into the logic here. |
I think it would be good also to see how the utility 'gdal_contour' handles this same data. |
I've had generated a whole contour dataset before using the mapserver contour layer. It went ok, as it goes OK when you don't set any CONTOUR_INTERVAL and just rely on CONTOUR_LEVELS. I think there is a computation made for the contour lines based on CONTOUR_INTERVAL options which fires the exception when some pixels have NODATA. |
in mapcontour.c, line 617 : why is the option bUseNoData set to FALSE ? |
I think I have a clue : the NODATA value is -3.40282e+38 in the DEM files !!! |
Indeed (if that nodata value is actually hit). Should be fixed per #6183 but I only made sure it compiled. Could you confirm it fixes your issue ? |
Complete crash even on the getCapabilties... sorry :-( |
I'd suspect an issue in your build environment. msautotest is happy with my change and I don't think the modified code paths should be hit by GetCapabilities |
indeed, my server is broken, I can't figure out why. I will fix that tomorrow. Cheers. |
Mapserver fixed, but contour lines still don't show up on the coast. |
Actually the error is correctly handled by MapServer now, which doesn't crash no more. |
I'm not sure it does, since I have seen a different behaviour from Mapserver (error message instead of crash) but not the expected one. Do you confirm the display of contours at high scale ? does the code to use is mapserver-7.6-branch ? |
@gsueur I'm testing using shp2img. Can you provide here new EXTENT values that cause your crash? Actually, I'll try to generate some...... (I used master branch) |
Contour layer: take into account nodata value from GDAL raster (fixes #6182)
After comprehensive tests on branch master (and not 7.6 like the backport tag mislead me), I can confirm everything is fine. |
…-branch-7-6 [Backport branch-7-6] Contour layer: take into account nodata value from GDAL raster (fixes #6182)
Hi,
I've set up a contour layer using a VRT file assembling 4 Copernicus EU DEM files.
The contour layer is neat, but it makes MapServer to crash every time I go on the coastline.
How can I get a complete error message to help identify the problem ?
Thanks
The text was updated successfully, but these errors were encountered: