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
Adding geopandas? #1569
Comments
We can try to include it. It does have a number of dependencies which would also need to be packaged, and as far as I remember GIS related tools tend to be complex to package. More generally we need to switch to a build setup where all packages are not re-built for each commit, as that takes a long time (even with ccache) and is not really necessary. |
geo pandas depandents on gdal, it is very heavy. a light solution is geopandas + shapely + pyproj. |
Yes, shapely would be a must. Pyproj and fiona seem like hard dependencies, too. |
For shapely, adding ctypes support (#728) is a blocker. For pyproj and fiona someone would need to try to create the corresponding pyodide package and see if there are any issues. |
I think the biggest trouble gdal, It is hard to be installed even on native python, and gdal is not pythonic. geopandas is a dataframe with a geometry columns and a crs. So if it is difficult to support gdal and fiona, I think we can give up them. I can try to build a light repo. just need (numpy, pandas shapely, pyproj), and some light or pure python lib for io, such as (h5py, netCDF for raster, pyshp, simplekml for vector) shapely is important, not only in geography
|
The next issue for shapely is to port libgeos: |
I made an attempt at building libgeos. So far I ran into the warning:
and some linker errors:
|
Looks like |
Okay so I got it building and installing mostly correctly, but I am not sure how to convince it to build a shared library (currently it's just building |
Asked about this on emscripten emscripten-core/emscripten#15276 |
Perhaps this can help shed some light on GDAL and other hard to package libs: https://github.com/bugra9/gdal3.js |
Thanks for the information @leouieda. I'll try that when I have some bandwitdh. |
created a separate issue for adding fiona which is a geopandas dependency: #3091 |
Recently @jorisvandenbossche mentioned that it might be possible to build geopandas without some of the hard to build dependencies (at the cost of reduced functionality). Currently, we have shapely and pyproj available but not fiona & GDAL. Any suggestions on this, Joris? Unless I misunderstood you :) Any way to load GeoJSON without fiona? Or at least it feels more useful to try to build pyarrow #2933 and use the parquet backend in geopandas rather than spending that time to build GDAL. |
That's correct, you can use geopandas with only shapely and pyproj installed. We currently still list |
So if shapely and pyproj are already available (and pandas), and since geopandas is a pure python package (that can be installed without specific effort?), it should actually already work, I think? |
Hah, yes, indeed it works with the REPL! >>> import micropip
>>> await micropip.install(['pandas', 'shapely', 'pyproj'])
>>> await micropip.install('geopandas', deps=False)
>>> import geopandas
>>> geopandas.__version__
'0.11.1' though I haven't tried using it further. |
Opened a follow up usability issue for GeoJSON in this case in geopandas/geopandas#2548 |
Installing from PyPI works, but the package size is a bit large (1MB compressed), and uncompressed:
So packaging it in Pyodide to unvendor tests and possibly later datasets #3092 would still be useful. |
Awesome, thanks so much!! ❤️ |
Is it thinkable to include geopandas? Or is that too heavily depending on C/C++ packages?
The text was updated successfully, but these errors were encountered: