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

Parse CRS if present #42

Open
Huite opened this issue Jan 16, 2023 · 2 comments
Open

Parse CRS if present #42

Huite opened this issue Jan 16, 2023 · 2 comments

Comments

@Huite
Copy link
Collaborator

Huite commented Jan 16, 2023

There are multiple ways to represent these (grid_mapping, etc, see also OGC conventions). Since the Ugrid topologies contain these, would be nice to use these if possible.

@Huite
Copy link
Collaborator Author

Huite commented Jun 16, 2023

The easiest way to identify this is via grid_mapping_name as far as I can tell. Best to check cf-xarray and rioxarray.

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Jul 5, 2023

The required attributes for dflowfm are EPSG_code or epsg and grid_mapping_name (latitude_longitude in case of wgs84, otherwise not present or Unknown projected). QGIS also requires EPSG_code or epsg attributes for it to read the crs from the file. I suggest to also use these two attributes in the xugrid code.

This is also relevant when generating a grid with meshkernel and writing it to a netcdf file with xugrid, currently the attribute has to be set manually to the dataset.

Also relevant for .ugrid.to_crs() since it would help if the crs variable attrs is also adjusted and not only the node_x/node_y variables.

One more thought: grid_mapping_name seems to only be part of the crs if it is geographic, does not exist for projected crs. In dfm_tools I did a quick and dirty implementation of parsing the crs from FM model files in Deltares/dfm_tools#684

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

2 participants