podaac / hydrocron

API for retreiving time series of SWOT data
https://podaac.github.io/hydrocron/
Apache License 2.0
17 stars 4 forks source link

Option to download all reach and node data for a given reach using one call #255

Open Travis-Simmons opened 4 days ago

Travis-Simmons commented 4 days ago

Right now, we are grabbing the features we need for a reach, then doing separate calls to grab those features for each node in the reach. It would be great for the number of calls, speed, and AWS costs on our end to be able to submit a request and get all of the reach and node data back. Please comment if this is not the standard format for feature requests and I will update the issue.

torimcd commented 3 days ago

Thanks @Travis-Simmons - I can see this being possible in two ways, curious what you expect/prefer to see:

  1. both the reach feature and the node features returned together in the same featurecollection (are you using geoJSON or CSV output type)? This would likely be a change to the feature=Reach behavior to maybe have a flag or a special field that indicates 'return all nodes for this reach as well as the reach specified'
  2. an option when querying nodes to query by reach_id instead of node_id? (A change to the feature=Node behavior, would not return the reach data so would still require 2 queries on your end)

@nikki-t I think both options would require setting up another GSI on the nodes table to allow querying by reach_id, though it looks like node_id contains the reach_id of the associated reach, so maybe there's some tricky ways around this by doing something like using the granuleUR output from the reach query to find the associated node granule, and filtering to the right node features by allowing a partial node_id to be entered. We'll need to do a feature analysis to sort out the details.

Travis-Simmons commented 2 days ago

The first option is exactly what I am looking for! If I could do the equivalent of something like feature=Reach&Node and get the csv (we are using csv) returned for all of the nodes and the reach that would be perfect.