After we get index support (#2036), revisit the align behavior for the row-wise operations, discussed in this PR originally #2038.
Specifically we should investigate the comments copilot made. The suggested fixes weren't right, but we may be missing something.
- Set the index properly. It seems to be a union.
geoseries = gpd.GeoSeries([Polygon([(0, 0), (1, 0), (1, 1)]), Polygon([(0, 0), (1, 0), (1, 1)]), Polygon([(0, 0), (1, 0), (1, 1)])], index=[1, 2, 3])
geoseries2 = gpd.GeoSeries([Polygon([(0, 0), (1, 0), (1, 1)]), Polygon([(0, 0), (1, 0), (1, 1)]), Polygon([(0, 0), (1, 0), (1, 1)])], index=[0, 1, 2])
res = geoseries.intersection(geoseries2, align=True)
print(res)
print(res.index)
0 None
1 POLYGON ((0 0, 1 1, 1 0, 0 0))
2 POLYGON ((0 0, 1 1, 1 0, 0 0))
3 None
dtype: geometry
Index([0, 1, 2, 3], dtype='int64')
- Investigate: Is it really an
outer join really correct in all cases? Or could it be something more along the lines of a union of left and right?
After we get index support (#2036), revisit the
alignbehavior for the row-wise operations, discussed in this PR originally #2038.Specifically we should investigate the comments copilot made. The suggested fixes weren't right, but we may be missing something.
outerjoin really correct in all cases? Or could it be something more along the lines of a union of left and right?