-
Notifications
You must be signed in to change notification settings - Fork 823
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
drop GDAL dependency #916
Comments
Looks like this is targeted for release in rasterio 1.4.0 around August 2023. |
Simple question, once direct dependency to GDAL will be dropped, will it be possible to install osmnx back with pip only or is there still other dependencies that cannot be handled by pure Python installation ? |
Hi @12rambau. The answer is nuanced, so let me provide some details. First, GDAL is an optional dependency, so even now it's not directly required by OSMnx itself unless you need to work with raster elevation data. But... Second, OSMnx depends on GeoPandas, which in turn depends on fiona, shapely, and pyproj. Those three packages in turn depend on the GEOS, GDAL, and PROJ libraries, all of which are written in C/C++. So, not pure Python. And that is where the installation can get tricky, depending on your system's configuration and the availability of pre-built binaries for it. Third, it's often possible to install OSMnx (and all of its dependencies) with pip... it's just not officially supported. There are too many variables with pip installation regarding platforms, system configuration, and binary availability for us to guarantee that it will work for everyone. This has nothing to do with OSMnx itself... it's just the dependencies of the dependencies that are not Python, so it's outside of our control. That said, I sometimes use pip to install OSMnx in Google Colab or in a test environment on one of my machines, and it works. It won't necessarily work for everyone, so we don't officially support it. If it works for you, great! If not, Conda installation is fully tested and supported. To summarize: Even if OSMnx no longer directly depends on GDAL itself, its dependencies still will, and your package manager will need to be able to install C/C++ libraries. Conda handles this seamlessly, whereas pip may or may not depending on the specifics of your system. That's why Conda is the standard installer across the Python geospatial science ecosystem. |
Thanks for the detailed answer, I know that That's very good also to know that your main fear is I think my usage of |
The upstream rasterio work for this issue has been deferred to v1.5.0 and currently does not appear to be in active development anymore: rasterio/rasterio#2699 (comment) |
If the native rasterio implementation is not going to happen this repo may offer a solution, it builds VRTs using rasterio. |
@wrignj08 I had seen this recently, but it wasn't clear to me if that project is mature or actively maintained. One thing we might consider as a "temporary" solution until this functionality is added to rasterio, is to include a vendored version of that vrt module in the OSMnx package (thus avoiding another dependency). |
fun fact I am already in the conversation so I was pinged when you linked my repo. The project is on stale mostly by lack of users. In short I managed to make it work for my own use case, As I don't have any other, I'm positive I'm missing lots of edge cases when I build this XML files. So yes actively maintained (I'm always aroud) but not mature. @gboeing why would like to vendor it entirely ? my only dependency is rasterio, the rest is pure vanilla python so I will not add anything to your lib. |
Ha! @12rambau you're just the person we needed :) Thanks for the insight into the project's status. Ok, so it's actively maintained but not fully mature. It may make sense to add rio-vrt as an optional dependency for OSMnx's VRT functionality needs. This would allow us to drop GDAL until when/if rasterio adds VRT functionality itself. Is anyone interested in putting together a minimal PR to swap out GDAL for rio-vrt, and perform some tests on elevation raster files from a variety of sources? |
See #1203 for WIP. |
OSMnx currently depends on GDAL directly in the
elevation
module to build VRTs, because rasterio doesn't expose equivalent functionality directly. However, it's not a good idea to import both rasterio and GDAL into the same working environment (see rasterio/rasterio#2573 (comment)).Rasterio devs are currently proposing new functionality that would allow us to build VRTs directly with rasterio. If so, we could drop the GDAL dependency. See this issue and this PR.
The text was updated successfully, but these errors were encountered: