-
Notifications
You must be signed in to change notification settings - Fork 366
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
Consider using Fiona for reading Shapefiles #250
Comments
Thanks for your input @rsignell-usgs - I've looked at Fiona a couple of times and have to admit to finding it harder to get into than the interface described here. In terms of performance Fiona is probably going to be better than PyShp (esp for spatial extractions), because under the hood it is using gdal where PyShp is pure python. On the flip side, PyShp is easier to install (because it doesn't depend on gdal) - though that benefit is diminished by your point that Fiona (and therefore gdal) is shipped with EPD. Whilst I'm not sold on the use of Fiona in cartopy (at least as a hard dependency) at this sage, I'm keen to make interfacing with it easier, so any suggestions (or code) would be really valuable. @sgillies - would you like to comment? |
P.S. Are you doing anything with cartopy that is worth going in the gallery? If you're keen, it'd be great to get some new examples in there! Cheers, |
I use also Fiona, now. For Mac OS X it is very easy to install with the Frameworks of KyngChaos (http://www.kyngchaos.com/software/frameworks), for Linux also and for Windows, Christoph Gohlke has compiled versions available of gdal/ogr (http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal) and Fiona (http://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona) for Python 2.6 and 2.7. |
Thanks for voicing your opinion @mlaloux. If we put the installation issues aside, are there things that you would like to do with Fiona+Cartopy which are not currently possible because of a cartopy limitation? I'm keen to expose the necessary interfaces to allow users to use whatever tool they are most comfortable with. Is there a particularly useful dataset that really wouldn't function well using the |
Pyshp also has big problems if, unfortunately, one of the fields of the table is empty; As a small example is worth a thousand words, the use of Fiona with my version of 110m-geography-regions-points.shp :
the result is one dictionary with the geometry and the attributes by element which is treated as all Python dictionaries
.... The same thing as your script shapereader.py ,which is wonderful work with Pyshp, but easier with Fiona. |
geopandas (which uses fiona) has a very convenient interface that already plays very smoothly with the cartopy API. I simply replaced |
@shoyer. Nice! Thanks for the tip! |
Was this fixed by #1000? |
I think so; I'm going to close. |
For reading shapefiles, I used to use pyshp, but switched to Fiona
http://toblerity.github.com/fiona/
based on recommendations from my opensource GIS buddies. It's pretty cool.
Fiona is also part of the Enthought Python Distribution, which is handy -- one less step for folks trying to build Cartopy.
Just a thought.
The text was updated successfully, but these errors were encountered: