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

Handle geospatial data in the BMI #80

Open
mdpiper opened this issue Feb 17, 2021 · 5 comments · May be fixed by #99
Open

Handle geospatial data in the BMI #80

mdpiper opened this issue Feb 17, 2021 · 5 comments · May be fixed by #99
Labels
enhancement requirement Required for release
Milestone

Comments

@mdpiper
Copy link
Member

mdpiper commented Feb 17, 2021

The BMI should handle data with a coordinate reference system (CRS), allowing such data to be exchanged between models with a BMI. The BMI should handle geospatial data in the form of vectors (points, lines, polygons) and raster grids.

@mdpiper mdpiper added enhancement requirement Required for release labels Feb 17, 2021
@mdpiper mdpiper added this to the BMI 2.1 milestone Feb 17, 2021
@mdpiper
Copy link
Member Author

mdpiper commented Mar 17, 2021

Link to #11, which has a similar request.

@mdpiper
Copy link
Member Author

mdpiper commented Mar 17, 2021

A suggestion for a new BMI function (in SIDL):

int get_grid_projection(in int grid, out string name);

where the output is a string with projection information in a standard format.

Note that the BMI doesn't specify which standard to use for the output; that's left to the implementation. We can, however, make recommendations; e.g., OGC Well-Known Text (WKT) representation of coordinate reference systems, or whatever xarray handles.

A return string of "" or "none" (but not the UDUNITS "1", which could be taken as an EPSG code) could indicate no projection information.

@mdpiper
Copy link
Member Author

mdpiper commented Mar 17, 2021

We also need a function (or functions) to specify the units of the grid in the CRS. Suggestions:

int get_grid_units(in int grid, out string units);

or, to be careful:

int get_grid_x_units(in int grid, out string units);
int get_grid_y_units(in int grid, out string units);
int get_grid_z_units(in int grid, out string units);

The return is a string; e.g., "meters", "m", "degrees", "deg".

We can recommend UDUNITS strings, like we do for variables and time.

@mdpiper
Copy link
Member Author

mdpiper commented Mar 18, 2021

We should also have an example that demonstrates this new functionality.

The current sample implementations wouldn't use the new functionality, since they're just models of heat diffusion on a plate. And I assert that they should be left as-is, since they're simple and generic, by design.

A candidate: @gantian127's SoilGrids data component could be modified. This wouldn't change the API or CLI of the component, but it would change the BMI, using the new functions to wrap the CRS information input through the API or CLI. We could then refer to this as the official sample implementation of the new functions.

@mdpiper
Copy link
Member Author

mdpiper commented Mar 17, 2022

For reference, Data Carpentry has a short, useful lesson on CRS.

@mdpiper mdpiper modified the milestones: BMI 2.1, BMI 2.2 Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement requirement Required for release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant