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

Add support for geospatial data #99

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from

Conversation

mdpiper
Copy link
Member

@mdpiper mdpiper commented Mar 17, 2022

This PR adds four new functions that, together, allow a user to represent geospatial data in a BMI:

  • get_grid_coordinate_names
  • get_grid_coordinate_units
  • get_grid_coordinate
  • get_grid_crs

The changes in this PR are part of the BMI 2.1 Milestone. The BMI version has been incremented to v2.1-beta.

A summary of each function, and the problem it addresses, is given below.

get_grid_coordinate_names

This function supports the get_grid_coordinate function, described below, allowing coordinates to be named something other than x, y, and z (e.g., lon and lat for geographic data). The function is patterned on the existing get_input_var_names function: given a grid identifier, the function returns a 1D string array of coordinate names.

This resolves #90.

get_grid_coordinate_units

This function gets the units of a grid coordinate; e.g., a projected CRS may use meters for spatial coordinates. The function is patterned on the existing get_var_units function: given a grid identifier and a coordinate name from get_grid_coordinate_names, return the units of the coordinate as a string.

This resolves #87. See #90 (comment) for some discussion on this new function.

get_grid_coordinate

This function is patterned on, and supersedes, the get_grid_[xyz] functions. Given a grid identifier and a coordinate name (like "x"), this function gets a 1D array of locations for the coordinate. Put another way, given "x", this function replicates the behavior of get_grid_x.

The get_grid_[xyz] functions have been marked as deprecated in the documentation.

This resolves #88.

get_grid_crs

This is the primary function of this PR, and also the simplest. Given a grid identifier, return a string with coordinate reference system (CRS) information. The BMI does not stipulate the format of the CRS information. See the documentation for this function for more information and a brief example.

Resolves #80, resolves #11.

Also arranged functions to match order in documentation + removed
stale headers.
Also:
* Updated ordering
* Removed deprecated functions
@mdpiper mdpiper requested a review from mcflugen March 17, 2022 20:49
@mdpiper
Copy link
Member Author

mdpiper commented Mar 17, 2022

@gregtucker This PR addresses the geospatial BMI task from CSDMS 3.

@mdpiper
Copy link
Member Author

mdpiper commented Mar 17, 2022

The docs for the branch are active: https://bmi.readthedocs.io/en/mdpiper-get-grid-projection/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant