Skip to content
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 asset for bbox method #184

Merged
merged 1 commit into from Oct 20, 2021
Merged

add asset for bbox method #184

merged 1 commit into from Oct 20, 2021

Conversation

vincentsarago
Copy link
Member

closes #181

This PR also fix an issue where get_assets would have returned assets multiple times. We now keep asset only once but keep the order.

@@ -137,8 +156,10 @@ def get_assets(self, x: int, y: int, z: int) -> List[str]:
mercator_tile = mercantile.Tile(x=x, y=y, z=z)
quadkeys = find_quadkeys(mercator_tile, self.quadkey_zoom)
return list(
itertools.chain.from_iterable(
[self.mosaic_def.tiles.get(qk, []) for qk in quadkeys]
dict.fromkeys(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dict.fromkeys return set of data but keep the order of appearance

@vincentsarago vincentsarago merged commit fb1485b into master Oct 20, 2021
@vincentsarago vincentsarago deleted the assets-from-bbox branch October 20, 2021 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add assets_for_bbox to the backend methods
1 participant