-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add MultiAssetsReader base class and refactor STACReader #225
Conversation
"center": self.center, | ||
"minzoom": self.minzoom, | ||
"maxzoom": self.maxzoom, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we were creating a Class with COGReader as parent so both center
and spatial_info
existed. I added those back for compatibility
for (t, m), asset in _filter_tasks(tasks): | ||
tasks = create_tasks(reader, chunks, threads, *args, **kwargs) | ||
for (t, m), asset in filter_tasks( | ||
tasks, allowed_exceptions=(TileOutsideBounds,) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref #224, we allow TileOutsideBounds
errors to be passed, they will still be logged
for asset in assets | ||
] | ||
else: | ||
return ((reader(asset, *args, **kwargs), asset) for asset in assets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New submodule because those functions are not just used in mosaic now
rio_tiler/io/base.py
Outdated
if not tile_exists(self.bounds, tile_z, tile_x, tile_y): | ||
raise TileOutsideBounds( | ||
"Tile {}/{}/{} is outside image bounds".format(tile_z, tile_x, tile_y) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this. Checking if the tile is outside the bounds here lets us raise before doing more file reading BUT it makes the class not really extendable for rio-tiler-crs
closes #224
closes #213
In addition to ☝️, this PR adds a new Abstract base for Multiple Assets merging (mainly for rio-tiler-pds but also used in STACReader). With this, we can specify any kind of Reader within the
MultiAssetsReader
. Before we were using therio_tiler.io.cogeo.multi_*
methods tied to COGReader.cc @kylebarron @geospatial-jeff