-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Description
Addressing the resto issue - "pystac-client request with intersects fails against resto".
Apparently pystac_client sends intersects property with trailing double quotes i.e. :
from pystac_client import Client
client = Client.open("https://tamn.snapplanet.io")
collection = "S2"
geometry = '{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}'
search = client.search(method="GET", collections=[collection], intersects=geometry)
print(len(list(search.items_as_dicts())))On resto side, the intersects property string retrieved format is the following:
intersects= "\"{\\\"type\\\": \\\"Polygon\\\", \\\"coordinates\\\": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}\""
It looks like there is a double encoding of the string (i.e. trailing double quotes and slashes). The right encoding should be:
intersects= "{\"type\": \"Polygon\", \"coordinates\": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}"
gadomski
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working