Skip to content

Commit

Permalink
HARMONY-1859: Updated documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ygliuvt committed Sep 9, 2024
1 parent 0d5ccda commit 1840365
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 1 addition & 2 deletions examples/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
"id": "a22a34f6-36a5-4554-b248-1b3e599dc4c2",
"metadata": {},
"source": [
"Example of submitting a request with WKT spatial:"
"Example of submitting a request with WKT spatial. The supported WKT geometry types are listed at: https://harmony-py.readthedocs.io/en/latest/api.html#harmony.harmony.WKT"
]
},
{
Expand All @@ -340,7 +340,6 @@
"request = Request(\n",
" collection=collection,\n",
" spatial=WKT('POLYGON((-140 20, -50 20, -50 60, -140 60, -140 20))'),\n",
" # spatial=WKT('POINT(-40 10)'),\n",
" granule_id=['C1233800302-EEDTEST'],\n",
" max_results=1,\n",
" temporal={\n",
Expand Down
13 changes: 11 additions & 2 deletions harmony/harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,15 @@ def __repr__(self) -> str:


class WKT:
"""The Well Known Text (WKT) representation of Spatial."""
"""The Well Known Text (WKT) representation of Spatial.
Supported WKT geometry types are: POINT, MULTIPOINT, POLYGON, MULTIPOLYGON.
Example:
spatial=WKT('POINT(-40 10)')
spatial=WKT('MULTIPOINT((-77 38.9),(-40 10))')
spatial=WKT('POLYGON((-140 20, -50 20, -50 60, -140 60, -140 20))')
spatial=WKT('MULTIPOLYGON(((10 10, 20 20, 30 10, 10 10)),((40 40, 50 50, 60 40, 40 40)))')
"""

def __init__(self, wkt: str):
"""Constructs a WKT instance of spatial area.
Expand Down Expand Up @@ -256,7 +264,8 @@ class Request(BaseRequest):
Args:
collection: The CMR collection that should be queried
spatial: Bounding box spatial constraints on the data
spatial: Bounding box spatial constraints on the data or Well Known Text (WKT) string
describing the spatial constraints.
temporal: Date/time constraints on the data provided as a dict mapping "start" and "stop"
keys to corresponding start/stop datetime.datetime objects
Expand Down

0 comments on commit 1840365

Please sign in to comment.