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

Document - add_first/add_last for Update #69

Open
vincentsarago opened this issue May 1, 2020 · 0 comments
Open

Document - add_first/add_last for Update #69

vincentsarago opened this issue May 1, 2020 · 0 comments

Comments

@vincentsarago
Copy link
Member

in

assets = [*new_assets, *assets] if add_first else [*assets, *new_assets]

we either append the new dataset before or after the existing dataset. This behaviour could be confusing for some users

# Existing mosaic
mosaic_1 = {"tile": {"0": ["cog1.tif"]}}

# New list of COG
dataset = ["2.tif", "3.tif"]

# Add First
with MosaicBackend(None, mosaic_def = mosaic_1) as mosaic:
    feats = get_footprints(dataset)
    mosaic.update(feats, add_first=True)

> mosaic_1 = {"tile": {"0": ["2.tif", "3.tif", "cog1.tif"]}}

# Add Last
with MosaicBackend(None, mosaic_def = mosaic_1) as mosaic:
    feats = get_footprints(dataset)
    mosaic.update(feats, add_first=False)

> mosaic_1 = {"tile": {"0": ["cog1.tif", "2.tif", "3.tif"]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant