Comments (8)
I think this is the recommended approach, because this is the easiest way to get data from a shapefile into spatialpandas. A shapefile is a custom format for which you need a (nontrivial) reader, and that isn't included in spatialpandas.
One way is thus to use geopandas (actually fiona or pyogrio, wrapping GDAL). Another way could be to use pyshp if you want to avoid a GDAL dependency, but then you will still have to do the conversion from the pyshp output to what spatialpandas needs yourself.
from spatialpandas.
@jbednar, Your timing in mentioning Awkward is well timed, I literally just clicked to this notification coming from dask-awkward. It is exciting to see you guys moving that forward. :)
Coincidences aside, I really appreciate the efforts, both voluntary and involuntary, you and your team put in to supporting the community, and the same goes for @jorisvandenbossche and the geopandas team. It's amazing how much work and effort goes into building up this ecosystem.
from spatialpandas.
We definitely do not want to try to make SpatialPandas compete with GeoPandas for what GeoPandas already does!
from spatialpandas.
@rrpelgrim,
I think issue #1 is a great reference from the original author of the package on the topic. Specifically:
Non-goals
spatialpandas will be focused on geometry only, not geography. As such:
- No built-in support for loading data from geography-specific file formats
- No dependency on GDAL/fiona
- No coordinate reference frame logic
I do wonder if some projects like pyshp, which was previously mentioned, would benefit from offering spatialpandas as an output option.
I think spatialpandas is great for us, particularly for distributed workloads, but considering some of the great work they have been doing on dask-geopandas, so I'm not sure how much additional value it offers the ecosystem to add many more features here. That said, I think if other lightweight geospatial packages were interoperable with it, it could be very beneficial for users looking to avoid the heavier and occasionally fragile stack of dependencies geopandas is built on top of. But it is hard to imagine ever approaching feature parity, considering the amazing depth of functionality that stack provides.
It should also be noted, that ultimately this project is under the holoviz team organization, who potentially, and justifiably, may be somewhat sensitive to adding features that would become future maintainability challenges.
from spatialpandas.
We at HoloViz would never complain about other packages like pyshp generating spatialpandas compatible output. 🙂
The original author of issue 1 has moved on from our group, so it's up to me now, I guess. BTW, we will soon be looking at whether Awkward arrays could work as a basis for spatialpandas, and if so the task would then be to connect pyshp with Awkward. Can't really look at that until June, though!
from spatialpandas.
Spatialpandas objects have a from_shapely
classmethod (see e.g. https://github.com/holoviz/spatialpandas/blob/master/spatialpandas/geometry/ring.py), which looks like it would work if you use Shapely to read it.
from spatialpandas.
@andhuang-CLGX, I would definitely suggest reading shapefiles with geopandas and then converting that to a spatialpandas dataframe.
from spatialpandas.
@brl0 - could you say something about why this is the recommended approach? Are there plans to add an equivalent of geopandas.read_file('file.shp')
?
from spatialpandas.
Related Issues (20)
- linearrings TypeError using shapely 2.0 HOT 1
- Support numpy 1.24
- ValueError: Keyword 'validate_schema' is not yet supported with the new Dataset API HOT 1
- Set python-snappy as optional dependency to work with Python 3.11 on pip install HOT 2
- Being able to instanciate empty GeoDataFrame HOT 1
- Faster construction of `PolygonArray` and `MultiPolygonArray` HOT 1
- `RecursionError` After Pandas 2.1.0 Release
- Geometry test failures in CI
- Pandas 2.2.0 rc0 emit warning HOT 1
- DaskGeoDataFrame parquet write error - Series object has no attribute total_bounds HOT 7
- GeometryArray.__geitem__ does not preserve dtype
- DaskDataFrame to DaskGeoDataFrame HOT 3
- spatialpandas failure on Dask Remote Cluster HOT 2
- error when importing DaskGeoDataFrame HOT 11
- dask.dataframe containing spatialpandas doesn't seem to work with hvplot
- Process for creating new release HOT 2
- dask `2021.8.0` breaks parquet io HOT 3
- Fixes required for new release HOT 2
- Set up code coverage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spatialpandas.