Skip to content

Commit

Permalink
Remove non-relevant case. If there are zero results, no list is retur…
Browse files Browse the repository at this point in the history
…ned. If there is 1 result, it is also the last result.
  • Loading branch information
EmileSonneveld committed Mar 22, 2023
1 parent 2ffba84 commit dfa4be8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions openeo_driver/save_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,15 +505,14 @@ def get_data(self):
df = pd.concat(map(pd.read_csv, paths))
features = df.feature_index.unique()
if str(features.dtype) == 'int64':
# TODO: This logic might get cleaned up when one kind ove vector cube is used everywhere
if isinstance(self._regions, DriverVectorCube):
amount_of_regions = len(self._regions.get_geometries())
elif isinstance(self._regions, DelayedVector):
geometries = list(self._regions.geometries)
amount_of_regions = len(geometries)
elif isinstance(self._regions, GeometryCollection):
amount_of_regions = len(self._regions)
elif isinstance(self._regions, BaseGeometry):
amount_of_regions = 1 # layercatalog.py:1026 implies that this is a single polygon
else:
_log.warning("Using polygon with largest index to estimate how many input polygons there where.")
amount_of_regions = features.max() + 1
Expand Down

0 comments on commit dfa4be8

Please sign in to comment.