Replies: 1 comment 2 replies
-
A custom snippet to achieve what I need: import json
import pathlib
from typing import Dict
from cogeo_mosaic.backends import MosaicBackend
from cogeo_mosaic.mosaic import MosaicJSON
def dem_stac_accessor(feature: Dict):
return feature["assets"]["elevation"]["href"]
items = pathlib.Path("items")
features = []
for item in items.iterdir():
with open(item) as src:
features.append(json.load(src))
mosaicjson = MosaicJSON.from_features(
features, minzoom=10, maxzoom=19, accessor=dem_stac_accessor
)
with MosaicBackend("mossaic.json", mosaic_def=mosaicjson) as mosaic:
mosaic.write(overwrite=True) @vincentsarago do you think this use-case is general enough to add its support via CLI? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a huge list of STAC items I want to build a mosaicJSON from. Currently only
feature["properties"]
can be specified with--property
argument and there is no way to extract URLs out of the assets. Am I missing something? I could extract URLs from STAC items and usecogeo-mosaic create
instead ofcogeo-mosaic create-from-features
but it takes hours to query footprints.Beta Was this translation helpful? Give feedback.
All reactions