Skip to content

Document - add_first/add_last for Update #69

Description

@vincentsarago

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"]}}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions