Skip to content

Commit

Permalink
Make intersect geom_field optional (#4)
Browse files Browse the repository at this point in the history
* Make geom_field optional

* Fix flake8
  • Loading branch information
webb-ben authored Jul 13, 2023
1 parent c3cff7b commit 736987f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pygeoapi_plugins/process/intersect.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def execute(self, data):
if not data.get('url') or not data.get('collection'):
raise ProcessorExecuteError(f'Invalid input: {data.items()}')
feature_url = data['url']
geom_field = data['geom_field']
geom_field = data.get('geom_field')
collection = data['collection']

LOGGER.debug(f'Fetching {feature_url}')
Expand All @@ -190,6 +190,9 @@ def execute(self, data):
LOGGER.debug(f'Using geom from configuration: {geom_field}')
else:
LOGGER.debug(f'Using provided geom field: {geom_field}')
if not geom_field:
msg = f'Invalid geom_field: {data.items()}'
raise ProcessorExecuteError(msg)

LOGGER.debug(f'Intesecting {cname} with backend {provider}')
outputs = self._intersect(feature, geom_field, provider)
Expand Down

0 comments on commit 736987f

Please sign in to comment.