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

formatting user geometries #2

Open
HeatherSavoy-USDA opened this issue Feb 17, 2022 · 2 comments
Open

formatting user geometries #2

HeatherSavoy-USDA opened this issue Feb 17, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@HeatherSavoy-USDA
Copy link
Collaborator

HeatherSavoy-USDA commented Feb 17, 2022

Currently, the API expects the user geometries as strings in the following format:

Polygon endpoint:

Specifies the clip boundary for the subset operation. The boundary can be specified in one of two ways: 1) The upper left and lower right corners of a bounding box for subsetting the data, specifed as a comma-separated list of the form "(UPPER_LEFT_X,UPPER_LEFT_Y),(LOWER_RIGHT_X,LOWER_RIGHT_Y)."; 2) A comma-separated list of coordinates defining the vertices of a clip polygon as in "(X1,Y1),(X2,Y2)...".

Points endpoint:

The x and y coordinates of point locations for extracting from the data, specified as x1,y1;x2,y2;...

This package currently supports the first polygon format as a list of two coordinate pairs. This should be expanded to accept any of the following input, then extract+format coordinate info for the API (assuming endpoint from format):

  • sf objects with POLYGON or MULTIPOINT geometry (polygon or point endpoint, respectively)
  • sp SpatialPolygon* or SpatialPoint* objects (polygon or point endpoint, respectively)
  • geojson polygon or multipoint objects (polygon or point endpoint, respectively)
  • raster object (polygon endpoint)
  • c(xmin,ymin,xmax,ymax) (polygon endpoint)
  • data.frame or tibble with two columns (point endpoint)
  • list of coordinate pairs (point endpoint)
  • or any of the three string formats above
@HeatherSavoy-USDA HeatherSavoy-USDA added the enhancement New feature or request label Feb 17, 2022
@HeatherSavoy-USDA
Copy link
Collaborator Author

API now accepts more geometry formats, including file upload.

@HeatherSavoy-USDA
Copy link
Collaborator Author

Current status: most but not all of these geometry types are supported.

Supported: sf and sp objects, geojson file, data.frame for both endpoints. + shapefiles and csv.

Not supported: vector or lists of coordinates, or strings to directly pass along to GeoCDL .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant