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/OGR: replacing command line usage with proper Python bindings #14

Open
pkerins opened this issue Jun 20, 2019 · 1 comment
Open
Labels
refactoring reworking existing functionality for speed, stability, etc

Comments

@pkerins
Copy link
Contributor

pkerins commented Jun 20, 2019

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 the os module is imported, after which it fails--unless you start the notebook server from the geoml environment rather than the base 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 in load_geotiff, write_1band_geotiff, and write_multiband_geotiff in util_rasters.py. I believe that the osgeo libraries expose all the relevant GDAL functionality; if that is not the case then we may need to modify or close this issue.

@pkerins pkerins added the refactoring reworking existing functionality for speed, stability, etc label Jun 20, 2019
@Taufiq06
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring reworking existing functionality for speed, stability, etc
Projects
None yet
Development

No branches or pull requests

2 participants