Skip to content

Commit

Permalink
Handle missing case
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Feb 3, 2021
1 parent 381e6cc commit b8528d1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions emu/processes/wps_geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ def _handler(self, request, response):
if vec_file is None and ras_file is None:
raise Exception("You need to provide at least one dataset.")

rasters = list()
for dataset in request.inputs["raster"]:
rasters.append(dataset.file)

Centroid = namedtuple("Centroid", "x y")
centroid = Centroid(0, 0)

Expand Down Expand Up @@ -146,8 +142,10 @@ def _handler(self, request, response):
centroid.x, centroid.y
)
response.outputs["bounds"].data = bounds
response.outputs["raster"].file = subset_gtiff

if subset_gtiff is not None:
response.outputs["raster"].file = subset_gtiff
else:
response.outputs["raster"].data = ""
response.update_status("PyWPS Process completed.", 100)

return response

0 comments on commit b8528d1

Please sign in to comment.