From f19b49f44ac57f9398d9c7cb446df80492130eb9 Mon Sep 17 00:00:00 2001 From: Chris Holmes Date: Thu, 5 Nov 2020 03:59:15 -0800 Subject: [PATCH] updates to examples to be a bit more clear (#53) * updates to examples to be a bit more clear * Update examples.md Co-authored-by: Matthias Mohr * fix for markdown linting Co-authored-by: Matthias Mohr --- examples.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/examples.md b/examples.md index 7f6e1a03..f90fed84 100644 --- a/examples.md +++ b/examples.md @@ -16,10 +16,10 @@ Request 100 results in `mycollection` from New Zealand: GET /collections/mycollection/items?bbox=160.6,-55.95,-170,-25.89&limit=100 ``` -Request all the data in `mycollection` that is in New Zealand from January 1st, 2019: +Request all the data in `mycollection` that is in New Zealand at anytime on January 1st, 2019: ```http -GET /collections/mycollection/items?bbox=160.6,-55.95,-170,-25.89&datetime=2019-01-01T00:00:00Z/2019-01-01T23:59:59ZZ +GET /collections/mycollection/items?bbox=160.6,-55.95,-170,-25.89&datetime=2019-01-01T00:00:00Z/2019-01-01T23:59:59Z ``` Request 10 results from the data in `mycollection` from between January 1st (inclusive) and April 1st, 2019 (exclusive): @@ -30,6 +30,19 @@ GET /collections/mycollection/items?datetime=2019-01-01T00:00:00Z/2019-03-31T23: ## STAC API +The STAC API `/search/` endpoint can support the same requests as above, as POST. + +Request 100 results in `mycollection` that is in New Zealand at anytime on January 1st, 2019: + +```json +{ + "collections": ["mycollection"], + "bbox": [160.6,-55.95,-170,-25.89], + "limit": 100, + "datetime": "2019-01-01T00:00:00Z/2019-01-01T23:59:59Z" +} +``` + Use the *[Query](extensions/query/README.md)* extension to search for any data falling within a specific geometry collected between Jan 1st and May 1st, 2019: @@ -40,12 +53,12 @@ Request to `POST /search`: "intersects": { "type": "Polygon", "coordinates": [[ - [-77.08248138427734, 38.788612962793636], [-77.01896667480469, 38.788612962793636], - [-77.01896667480469, 38.835161408189364], [-77.08248138427734, 38.835161408189364], - [-77.08248138427734, 38.788612962793636] + [-77.0824, 38.7886], [-77.0189, 38.7886], + [-77.0189, 38.8351], [-77.0824, 38.8351], + [-77.0824, 38.7886] ]] }, - "time": "2019-01-01/2019-05-01" + "datetime": "2019-01-01/2019-05-01" } ```