issue(s)
I'm currently browsing the CLMS portfolio via datacatalogue website and the wekeo store and trying to establish a sensible search script (with product types) as I'll be needing the same datasets for several locations.
While doing this, I struggled to get to terms with the API query calls for the search. I hope it is okay to summarise several issues here (as they are somewhat related)
Namely, I was missing documentation (also in the examples) of in my opinion rather important keywords like
- "resolution" (e.g. '10m')
- "year" (e.g. 2018, which may also be 2018-2021 for grassland change)
- "start_date"/"end_date"/"startdate"/"enddate" or similar as these are highly relevant for timeseries search and it should be clear which one is the correct setting (or the options per dataset if this isn't clear)
- "product_type" (which alters the search considerably, see details below)
Especially, the product type is highly relevant for the search as a dataset may contain several layers. I found that a query with a set bbox but only the dataset returns matches outside the bbox.
mwe for bbox search
from hda import Client, Configuration
conf = Configuration() # taken from $HOME/.hdarc
client = Client(config=conf,
timeout=5,
retry_max=2,
progress=True,
sleep_max=3,)
query = {
# grassland
'dataset_id': "EO:EEA:DAT:HRL:GRA",
"product_type": 'Herbaceous Cover',
"bbox": [
-2.854854, # lon min
42.764679, # lat min
-2.543907, # lon max
42.936969 # lat max
],
"startIndex": 0,
'resolution': '10m',
'year': 2018,
}
matches = client.search(query, limit=200)
# matches contains one match (as it should be)
query.pop('product_type')
matches = client.search(query, limit=200)
# matches is > 200 (I stopped at 500 to be honest)
# I'd expect around 27 or so matches based on the CLMS available layers
# I downloaded some and found that the results are outside the BBOX
(temporary) solutions
As such, it appears that the search API does not honor the bbox parameter when not called with a product type (ideally, this would be fixed at the source if it is feasible). Alternatively, or to intermediately amend, this shortcoming, a function for .producttypes() could be added that is called before the search to iterate over the actually available types. What do you think?
issue(s)
I'm currently browsing the CLMS portfolio via datacatalogue website and the wekeo store and trying to establish a sensible search script (with product types) as I'll be needing the same datasets for several locations.
While doing this, I struggled to get to terms with the API query calls for the search. I hope it is okay to summarise several issues here (as they are somewhat related)
Namely, I was missing documentation (also in the examples) of in my opinion rather important keywords like
Especially, the product type is highly relevant for the search as a dataset may contain several layers. I found that a query with a set bbox but only the dataset returns matches outside the bbox.
mwe for bbox search
(temporary) solutions
As such, it appears that the search API does not honor the bbox parameter when not called with a product type (ideally, this would be fixed at the source if it is feasible). Alternatively, or to intermediately amend, this shortcoming, a function for .producttypes() could be added that is called before the search to iterate over the actually available types. What do you think?