Skip to content

Commit

Permalink
Use single pass over datasets when computing bounds
Browse files Browse the repository at this point in the history
Fixes issue #659
  • Loading branch information
Kirill888 committed Feb 14, 2019
1 parent 8e63ab5 commit 9bd8c07
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions datacube/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,8 @@ def _fuse_measurement(dest, datasets, geobox, measurement,


def get_bounds(datasets, crs):
left = min([d.extent.to_crs(crs).boundingbox.left for d in datasets])
right = max([d.extent.to_crs(crs).boundingbox.right for d in datasets])
top = max([d.extent.to_crs(crs).boundingbox.top for d in datasets])
bottom = min([d.extent.to_crs(crs).boundingbox.bottom for d in datasets])
return geometry.box(left, bottom, right, top, crs=crs)
bbox = geometry.bbox_union(ds.extent.to_crs(crs).boundingbox for ds in datasets)
return geometry.box(*bbox, crs=crs)


def dataset_type_to_row(dt):
Expand Down

0 comments on commit 9bd8c07

Please sign in to comment.