Skip to content
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

Tool crashing on 3D geometries #21

Open
ChocopieKewpie opened this issue Jun 18, 2023 · 3 comments
Open

Tool crashing on 3D geometries #21

ChocopieKewpie opened this issue Jun 18, 2023 · 3 comments

Comments

@ChocopieKewpie
Copy link
Member

Currently tool doesn't support geometries with a Z component.

@ChocopieKewpie
Copy link
Member Author

ChocopieKewpie commented Jun 18, 2023

Converting with shapely can simply be achieved with:

import shapely
import geopandas as gpd

def _3D_2D(geometry):
    new_geo = []
    for i in geometry:
        i=shapely.force_2d(i)
        new_geo.append(i)
    return new_geo

df = gpd.GeoDataFrame.from_file(some_shape)
df.geometry = _3D_2D(df.geometry)

@alpha-beta-soup
Copy link
Member

alpha-beta-soup commented Jun 18, 2023

It would probably need to drop M values too, in the case of XYZM, or XYM. But I've never actually seen an M value on anything but a line, which we don't yet support. (In that case, the M value could become an attribute.)

What we really need is a test suite and then we can throw degenerate and obscure cases at it.

@SPlanzer
Copy link

Just ran into this.

PAN-NZ on Lris is Polygon layer (Z),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants