Doc: Test and document image generation #13674
Open
+2,196
−2,345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@dbaston I tested and ran the
generate_images.pyscript used to generate images and figures for the GDAL docs. I added a note on how to set this up in a conda environment, and tested on Windows. I ran into a few issues, fixed by this PR:FAILED generate_images.py::test_gdal_raster_zonal_stats - _tkinter.TclError: invalid command name "tcl_findLibrary"- addingmatplotlib.use('Agg')resolved this issue, by removing the default GUI backend - I don't think it is required for the image generation.FAILED generate_images.py::test_gdal_raster_reclassify - AttributeError: 'NoneType' object has no attribute 'ReadAsMaskedArray'this was due to callingalg.Finalize()before getting the dataset. Do we have any docs about running algorithms in Python? What does alg.Finalize() do (I'm guessing it cleans up any in-memory datasets!).raster reclassifycode and image. Brackets were mismatched so the pixel with an original value of 5 is set to NoData when I think it should be 102. I have added the updated image, and fixed the brackets (there were a few places in the docs where this was the case). Maybe an error should be thrown in these cases as it was hard to spot?There remains one issue with the
check-geometrycommand - the line example has 2 geometry issues and so creates a MULTIPOINT output. This caused an errorFAILED generate_images.py::test_gdal_vector_check_geometry - RuntimeError: Algorithm.Run() failed: Terminating translation prematurely after failed.I tested in the command-line to get the underlying issue:
I switched to gpkg which got the test running, but still gives the warning:
Maybe the output of the tool should always be set to MULTIPOINT (rather than POINT as set in #13523)?