uxarray icon indicating copy to clipboard operation
uxarray copied to clipboard

Shapefile Reader

Open rajeeja opened this issue 1 year ago • 3 comments

Closes #635

Support Polygon and Multipolygon

rajeeja avatar Jun 03 '24 18:06 rajeeja

I'm wondering if this implementation can be generalized as a Grid.from_geopandas() or similar method as discussed in https://github.com/UXARRAY/uxarray/issues/635#issuecomment-1907005496

philipc2 avatar Aug 02 '24 20:08 philipc2

I'm wondering if this implementation can be generalized as a Grid.from_geopandas() or similar method as discussed in https://github.com/UXARRAY/uxarray/issues/635#issuecomment-1907005496

This makes sense, I will try to generalize it and at least add a test case for geojson also. It would have to be seen how the reader object is different when reading different kinds of format that are supported by geopandas: We may support a limited subset and we can specify what we support in test cases.

Thanks so much for the review. I will push the changes shortly

rajeeja avatar Aug 02 '24 21:08 rajeeja

will

I'm wondering if this implementation can be generalized as a Grid.from_geopandas() or similar method as discussed in #635 (comment)

This makes sense, I will try to generalize it and at least add a test case for geojson also. It would have to be seen how the reader object is different when reading different kinds of format that are supported by geopandas: We may support a limited subset and we can specify what we support in test cases.

Thanks so much for the review. I will push the changes shortly

Maybe for our Grid, it would make the most sense to have a Grid.from_geodataframe() method, where the user can provide a GeoDataFrame that contains the geometry we will read in.

The workflow would require the user to use the geopandas.read_file() or similar methods to first obtain a GeoDataFrame and then pass it into a Grid

import geopandas as gp
import uxarray as ux

# load in a shape (or other) file
gdf = gp.read_file(...)

# create a Grid from the GeoDataFrame
uxgrid = ux.Grid.from_geodataframe(gdf)

Pinging @kmsampson for any thoughts.

philipc2 avatar Aug 05 '24 17:08 philipc2

We should consider a basic User Guide notebook for this too. I can provide the quad-hexagon grid in multiple different formats (i.e. shape, geoparquet, etc.) to showcase this functionality.

I have some mesh files as a part of this, we want to be careful with how many we bundle as a part of the repo.

rajeeja avatar Sep 10 '24 14:09 rajeeja

We should consider a basic User Guide notebook for this too. I can provide the quad-hexagon grid in multiple different formats (i.e. shape, geoparquet, etc.) to showcase this functionality.

I have some mesh files as a part of this, we want to be careful with how many we bundle as a part of the repo.

Maybe using online files rather than having them all hosted in the repo?

erogluorhan avatar Sep 10 '24 19:09 erogluorhan

We should consider a basic User Guide notebook for this too. I can provide the quad-hexagon grid in multiple different formats (i.e. shape, geoparquet, etc.) to showcase this functionality.

I have some mesh files as a part of this, we want to be careful with how many we bundle as a part of the repo.

Maybe using online files rather than having them all hosted in the repo?

Do we have an issue open for this topic in general?

philipc2 avatar Sep 11 '24 12:09 philipc2

We should consider a basic User Guide notebook for this too. I can provide the quad-hexagon grid in multiple different formats (i.e. shape, geoparquet, etc.) to showcase this functionality.

I have some mesh files as a part of this, we want to be careful with how many we bundle as a part of the repo.

Maybe using online files rather than having them all hosted in the repo?

Do we have an issue open for this topic in general?

#946 would cover this also, not a explicit issue for this.

rajeeja avatar Sep 14 '24 18:09 rajeeja