Open ChocopieKewpie opened 1 year ago
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)
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.
Just ran into this.
PAN-NZ on Lris is Polygon layer (Z),
Currently tool doesn't support geometries with a Z component.