Comments (5)
This would be powerful. I might call the parameter something other than by_geom
; perhaps something like all_geoms
? We could implement this API immediately (albeit inefficiently) by using unary_union
on the other
geometry, couldn't we?
from geopandas.
@kjordahl yes and no: The standard GIS 'layer-style' way of working is based on something like this:
for each geom in layer1:
for each geom in layer2:
difference layer1 geom by layer2 geom
update layer1 geom
which is equivalent to using unary_union
on the other
geometry first. However, when it comes to things like intersect
or union
, things are slightly different. Now, additional geometries might be created, because parts of layer1 geom might intersect with several layer2 geoms, leading to a larger number of geoms in the output:
for each geom in layer1:
for each geom in layer2:
intersect layer1 geom with layer2 geom
add intersect to output
Having said all that, since we aren't necessarily working in the realm of layers with GeoPandas, perhaps we should drop this conceptual model and adopt an API that is equivalent to a unary_union
on other
first (with more efficient use of spatial indices down the line). That way instead of saying "intersect this layer with this other layer", we are saying "intersect each of these geometries with these other ones", which I think fits the pandas way of doing things better. Alternatively, if we wanted to stick with a layer concept, then we could always just return a geometry collection for things like intersect
and union
? The only problem with this is that fewer operations support this, and it would definitely make i/o more difficult for the user.
Long story short: yes, we can do this now if we are willing to do things differently than a GIS (which I think we should be willing to do). Also, having the control afforded by all_geoms
means we should probably still be able to do the GIS 'layer-approach' with some clever index alignments..?
from geopandas.
If we decide which way to go, I'll try to submit a pull request for some of this over the weekend.
from geopandas.
@cfarmer Do the spatial join and overlay functionality cover everything in this issue? Or are there additional "GIS-like" operations/concepts that we should look at?
from geopandas.
Closing for now. If something's missing from sjoin and overlay, let's bring up a new issue.
from geopandas.
Related Issues (20)
- BUG: Is it possible to use GeoPandas on Windows 7 ?
- BUG: Unable to append to a layer when using fiona backend HOT 3
- BUG: plotting_with_geoplot example is broken HOT 1
- ENH: Add a Voronoi Diagram algorithm HOT 1
- BUG: The dissolve feature generates a new geometry HOT 4
- REGR: incorrect order of left sjoin with within predicate HOT 1
- BUG: wrong foxpro DBF file read HOT 7
- Fiona 1.10a2 issues HOT 2
- ENH: support writing + filtered reading from bbox columns in GeoParquet HOT 4
- ENH: support reading and writing the geoarrow-based encodings of GeoParquet
- API: Series alignment for non binary op methods HOT 5
- PERF: optimize `==` and `!=` for GeoSeries (`GeometryArray.__eq__`)
- numpy dependency missing & numpy 2.0 support status? HOT 3
- ENH: inplace=True for .dissolve and .explode? HOT 4
- BUG: `pyogrio` doesn't like io.BytesIO? HOT 10
- BUG: Issue with webpage code interp HOT 1
- ENH: sjoin() should allow to return the distance when using the dwithin predicate, just like sjoin_nearest() HOT 3
- BUG: set_precision() doesn't work HOT 1
- ENH: CRS from GeoDataFrame not passed on to individual geometry objects HOT 3
- BUG: Unable to open files with fiona where filepath contains a # character HOT 3
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 geopandas.