Open pkerins opened 5 years ago
I have run into this issue while trying to run the notebook for preparing ground truth data. The GDAL function for rasterizing via command line was not working even when I was in the geoml environment. I want to give it a shot today for fixing this issue for at least places which prevent the core workflow to perform.
There are many places in the code where we use various GDAL functions (including OGR stuff) to accomplish various tasks. Currently, these are almost all executed on the command line, either via the Python
subprocess
library or by Jupyter notebook magic. These have the advantage of simplicity, but also some drawbacks in terms of stability. For example,ogrinfo
will work via notebook magic only until theos
module is imported, after which it fails--unless you start the notebook server from thegeoml
environment rather than thebase
environment.For greater stability and maximum pythonicness, we can replace these references to Python scripts (eg
gdal_merge.py
) with actual Python bindings. For example, these bindings are already utilized inload_geotiff
,write_1band_geotiff
, andwrite_multiband_geotiff
inutil_rasters.py
. I believe that theosgeo
libraries expose all the relevant GDAL functionality; if that is not the case then we may need to modify or close this issue.