Comments (5)
I think it should behave the same as binary predicates do when you don't specify align
, which means align and warn.
from geopandas.
This is the current situation.
function | param | solution | version |
---|---|---|---|
concave_hull | ratio, allow_holes | ignore index | 0.14 |
delaunay_triangles | tolerance, only_edges | ignore index | 0.14 |
offset_curve | distance, quad_seqs... | ignore index | 0.14 |
remove_repeated_points | tolerance | ignore index | 0.14 |
segmentize | max_segment_length | ignore index | 0.14 |
force_3d | z | ignore index | main |
buffer | distance... | raise for distance, ignore for others | 0.5 |
simplify | tolerance, preserve_topology | ignore index | shapely 2 |
interpolate | distance | raise | 0.5 |
So we don't align in any case. We either raise or ignore the index. Ignoring the index does not feel as a correct behaviour because users may expect alignment, which silently does not happen resulting in misaligned args. I think that we have two options:
- raise when the index is not equal like we do in buffer (for distance). This does not require any additional keywords and users can align themselves if needed. We can include a note on how in the error message.
- add
align
keyword everywhere and mirror the behaviour of binary geometry ops.
Given most of the affected methods are from 0.14, I think we can just do the hard breaking change here, whatever we decide. I am leaning towards the first option as it is easier but if we want to do full consistency, the second is probably better.
I would also hold with merging of shapely parity PRs affected by this so I can update them based on the selected behaviour.
from geopandas.
I'm leaning towards option 1, because we should be able to give a nice instructive error for this (here's how to align, and here's how to convert to an array if you didn't want to align). Personally feel adding an align keyword (and remembering to add an align keyword for any future methods) doesn't provide enough convenience to warrant extra complexity (even if it's not super complex).
From the perspective of a breaking change, I also like that we go from ignore -> raise, as then users need to deal with it in cases where it matters, vs ignore -> align (or align and and warn) by default which could be missed or ignored (appreciate not everyone would agree with that though)
from geopandas.
Yes, also agreed to go with option 1, and to do this as a breaking change. Adding an align
keyword everywhere seems a lot of bloat for a corner case that users can solve themselves (either aligning manually first, or passing the .values
), and in addition can also be ambiguous if there are multiple keywords where the value could be aligned or not.
from geopandas.
Cool. I'll shoot a PR for that in coming days and update relevant PRs accordingly.
from geopandas.
Related Issues (20)
- GeoPandas 1.0 release HOT 11
- MAINT: Fiona 1.10 support HOT 4
- BUG: up to 4 times slower in Linux compared to Windows when using gpd.read_file to read vector data HOT 6
- 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
- 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
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.