Closed hboisgon closed 1 year ago
I tried using the to_geodataframe method for UgridDataset but found two issues:
The lines in question:
https://github.com/Deltares/xugrid/blob/b6c4fb5570af34a264783e709e948114255a6a71/xugrid/core/dataset_accessor.py#L394-L403
An idea of implementation:
gdf = gpd.GeoDataFrame( index=grid.to_dataset()[dim].values.astype(str), data=ds[variables].to_dataframe(dim_order=dim_order) if len(variables)>0 else None, geometry=grid.to_shapely(dim), crs = grid.crs, )
Hi @hboisgon,
The CRS thing has an issue for itself with #138. Allowing to create a GeoDataFrame with only geometry seems reasonable.
I tried using the to_geodataframe method for UgridDataset but found two issues:
The lines in question:
https://github.com/Deltares/xugrid/blob/b6c4fb5570af34a264783e709e948114255a6a71/xugrid/core/dataset_accessor.py#L394-L403
An idea of implementation: