Skip to content

Instantly share code, notes, and snippets.

@parulnith
Created November 23, 2018 05:27
Show Gist options
  • Save parulnith/0ee0fe793b99093eb32cd2c2dacc304f to your computer and use it in GitHub Desktop.
Save parulnith/0ee0fe793b99093eb32cd2c2dacc304f to your computer and use it in GitHub Desktop.
# get images that overlap with our AOI
geometry_filter = {
"type": "GeometryFilter",
"field_name": "geometry",
"config": geojson_geometry
}
# get images acquired within a date range
date_range_filter = {
"type": "DateRangeFilter",
"field_name": "acquired",
"config": {
"gte": "2016-08-31T00:00:00.000Z",
"lte": "2016-09-01T00:00:00.000Z"
}
}
# only get images which have <50% cloud coverage
cloud_cover_filter = {
"type": "RangeFilter",
"field_name": "cloud_cover",
"config": {
"lte": 0.5
}
}
# combine our geo, date, cloud filters
combined_filter = {
"type": "AndFilter",
"config": [geometry_filter, date_range_filter, cloud_cover_filter]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment