Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.
  • When I run a batch script using a GDAL/OGR program, I can detect if an error occured by checking ERRORLEVEL for the value 1.

  • When using GDAL/OGR in python or .NET, I get an exception when an error occurs.

Question:
How do I detect if a Warning was issued during the execution?


Why?
Even though a process can execute to the end despite of warnings, the output might be corrupt with respect to the data I expect. You could argue that I ought to check for these corruptions, but since I have control of the entire process, I would like to be able to stop when a warning is issued.

share|improve this question
You can modify the error handling behaviour at the C level (see gdal.org/cpl__error_8h.html), including turning warning into errors and setting error handlers. I don't see anything that will expose that to non-C APIs though. – BradHards Dec 6 '12 at 20:16
1  
I think this question is more fitted to be asked at stackoverflow.com ? – nickves Dec 7 '12 at 0:57
@BradHards: I would rather not dive into the C code and compile the stuff my self. – Chau Dec 7 '12 at 7:38
@nickves: I have asked the question here because I expect the folks using GDAL/OGR to be using this forum. – Chau Dec 7 '12 at 7:39

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.