Skip to content

Commit

Permalink
Merge pull request #819 from tomkralidis/oacov-subset
Browse files Browse the repository at this point in the history
OACov: fix subsets parameterization
  • Loading branch information
tomkralidis committed Apr 28, 2022
2 parents 7ac4f27 + 6a45877 commit 41216fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion owslib/ogcapi/coverages.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,20 @@ def coverage(self, collection_id: str, **kwargs: dict) -> dict:
kwargs_['properties'] = ','.join(
[str(x) for x in kwargs['properties']])

for p in ['scale_axes', 'scale_size', 'subset']:
for p in ['scale_axes', 'scale_size']:
if p in kwargs:
p2 = p.replace('_', '-')
kwargs_[p2] = []
for s in kwargs[p2]:
val = '{}({},{})'.format(s[0], s[1], s[2])
kwargs_[p2].append(val)

if 'subset' in kwargs:
subsets_list = []
for s in kwargs['subset']:
subsets_list.append('{}({}:{})'.format(s[0], s[1], s[2]))
kwargs['subset'] = ','.join(subsets_list)

if 'scale_factor' in kwargs:
kwargs_['scale-factor'] = int(kwargs['scale_factor'])

Expand Down

0 comments on commit 41216fb

Please sign in to comment.