GLIMS-RGI / rgi_issue_tracker

Report issues about the RGI dataset
1 stars 0 forks source link

RGI 7.0 shapefile geometries are stored as 3D polygons #43

Open fmaussion opened 11 months ago

fmaussion commented 11 months ago

RGI version RGI v7.0

Describe the issue GLIMS provides the geometries as 3D polygons, and this is then carried over to the RGI files. Many shapefile readers do not have any problem with 3D geometries, but some do.

Expected outcome RGI files should not have a z dimension.

Suggested solution The files can be converted with python with:

import geopandas as gpd
df = gpd.read_file('RGI2000-v7.0-G-12_caucasus_middle_east')
df['geometry'] = gpd.GeoSeries.from_wkb(df.to_wkb(output_dimension=2).geometry)
df.to_file('RGI2000-v7.0-G-12_caucasus_middle_east_noz/RGI2000-v7.0-G-12_caucasus_middle_east.shp')

I'll run this on all of RGI 7.0 and share the files somewhere. This will be solved in RGI 7.1.