Return numberMatched if in STA response (#1259)
Attempt to return `@iot.count` in included in response. Including the query param `'$count' = 'true'` is costly on the SensorThings API endpoint when accessing the Observations entity. Some STA endpoints are including the count as a default.
This commit is contained in:
@@ -249,9 +249,13 @@ class SensorThingsProvider(BaseProvider):
|
||||
|
||||
# Make features
|
||||
response = self._get_response(url=self._url, params=params)
|
||||
v = response.get('value')
|
||||
|
||||
matched = response.get('@iot.count')
|
||||
if matched:
|
||||
fc['numberMatched'] = matched
|
||||
|
||||
# Query if values are less than expected
|
||||
v = response.get('value')
|
||||
while len(v) < limit:
|
||||
try:
|
||||
LOGGER.debug('Fetching next set of values')
|
||||
|
||||
Reference in New Issue
Block a user