We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Running the following code based on the example jupyter notebook:
import os import json import requests from requests.auth import HTTPBasicAuth
geojson_geometry = { "type": "Polygon", "coordinates": [ [ [ -122.43576049804688, 37.51299386065851 ], [ -122.34786987304686, 37.155938651244625 ], [ -122.07595825195312, 36.948794297566366 ], [ -121.8878173828125, 37.18110808791507 ], [ -122.43576049804688, 37.51299386065851 ] ] ] }
geometry_filter = { "type": "GeometryFilter", "field_name": "geometry", "config": geojson_geometry }
date_range_filter = { "type": "DateRangeFilter", "field_name": "acquired", "config": { "gte": "2018-03-01T00:00:00.000Z", "lte": "2018-04-30T00:00:00.000Z" } }
cloud_cover_filter = { "type": "RangeFilter", "field_name": "cloud_cover", "config": { "lte": 0.5 } }
combined_filter = { "type": "AndFilter", "config": [geometry_filter, date_range_filter, cloud_cover_filter] }
os.environ['PL_API_KEY']='' PLANET_API_KEY = os.getenv('PL_API_KEY')
item_type = "PSScene4Band"
search_request = { "interval": "day", "item_types": [item_type], "filter": combined_filter }
search_result = requests.post( 'https://api.planet.com/data/v1/quick-search', auth=HTTPBasicAuth(PLANET_API_KEY, ''), json=search_request) print(json.dumps(search_result.json(), indent=1))
The response is:
{ "general": [ { "message": "{"interval": "Rogue field"}" } ], "field": {} }
However, the above code with https://api.planet.com/data/v1/stats as the request URL instead returns expected results.
The text was updated successfully, but these errors were encountered:
I met the same error. I avoided the error to comment out "interval": "day" in search_request.
Sorry, something went wrong.
@tdk8 thanks so much!!
No branches or pull requests
Running the following code based on the example jupyter notebook:
import os
import json
import requests
from requests.auth import HTTPBasicAuth
geojson_geometry = {
"type": "Polygon",
"coordinates": [
[
[
-122.43576049804688,
37.51299386065851
],
[
-122.34786987304686,
37.155938651244625
],
[
-122.07595825195312,
36.948794297566366
],
[
-121.8878173828125,
37.18110808791507
],
[
-122.43576049804688,
37.51299386065851
]
]
]
}
geometry_filter = {
"type": "GeometryFilter",
"field_name": "geometry",
"config": geojson_geometry
}
date_range_filter = {
"type": "DateRangeFilter",
"field_name": "acquired",
"config": {
"gte": "2018-03-01T00:00:00.000Z",
"lte": "2018-04-30T00:00:00.000Z"
}
}
cloud_cover_filter = {
"type": "RangeFilter",
"field_name": "cloud_cover",
"config": {
"lte": 0.5
}
}
combined_filter = {
"type": "AndFilter",
"config": [geometry_filter, date_range_filter, cloud_cover_filter]
}
os.environ['PL_API_KEY']=''
PLANET_API_KEY = os.getenv('PL_API_KEY')
item_type = "PSScene4Band"
search_request = {
"interval": "day",
"item_types": [item_type],
"filter": combined_filter
}
search_result = requests.post(
'https://api.planet.com/data/v1/quick-search',
auth=HTTPBasicAuth(PLANET_API_KEY, ''),
json=search_request)
print(json.dumps(search_result.json(), indent=1))
The response is:
{
"general": [
{
"message": "{"interval": "Rogue field"}"
}
],
"field": {}
}
However, the above code with https://api.planet.com/data/v1/stats as the request URL instead returns expected results.
The text was updated successfully, but these errors were encountered: