CLI and Backends to work with MosaicJSON.
Project description
cogeo-mosaic
Create mosaics of Cloud Optimized GeoTIFF based on the mosaicJSON specification.
Documentation: https://developmentseed.org/cogeo-mosaic/
Source Code: https://github.com/developmentseed/cogeo-mosaic
Read the official announcement https://medium.com/devseed/cog-talk-part-2-mosaics-bbbf474e66df
Install
python -m pip install pip -U
python -m pip install cogeo-mosaic --pre
# Or from source
python -m pip install git+http://github.com/developmentseed/cogeo-mosaic
Notes:
- Starting with version 5.0, pygeos has been replaced by shapely and thus makes
libgeosa requirement. Shapely wheels should be available for most environment, if not, you'll need to have libgeos installed.
See it in action
- TiTiler: A lightweight Cloud Optimized GeoTIFF dynamic tile server (COG, STAC and MosaicJSON).
Contribution & Development
See CONTRIBUTING.md
License
See LICENSE
Authors
Created by Development Seed
See contributors for a listing of individual contributors.
Changelog
Unreleased
9.1.0 (2026-02-02)
- update: rio-tiler requirements
- update: type hints
9.0.2 (2025-12-15)
- add support for python 3.14
9.0.1 (2025-11-25)
- update morecantile requirements to
>=7.0
9.0.0 (2025-11-21)
-
update rio-tiler requirement to
>=8.0,<9.0 -
rename
cogeo_mosaic.backends.base.BaseBackendtocogeo_mosaic.backends.base.MosaicJSONBackendbreaking change -
cogeo_mosaic.backends.base.MosaicJSONBackendsubclassrio_tiler.mosaic.backend.BaseBackend -
remove
.centerproperty fromMosaicJSONBackendbreaking change -
reverseoption should be passed viasearch_optionsbreaking change# before with MemoryBackend(mosaic_def=...) as mosaic: ptsR = mosaic.point(-73, 45, reverse=True) # now with MemoryBackend(mosaic_def=...) as mosaic: ptsR = mosaic.point(-73, 45, search_options={"reverse": True})
8.2.0 (2025-05-06)
- allow
kwargsto be forwarded to backend'sget_assetsmethod fromassets_for_tile,assets_for_pointandassets_for_bboxmethods
8.1.0 (2025-02-13)
- add
lock=Lock()to cachetoolscachedinstance to avoid thread corruption - remove python 3.8 support
- add python 3.13 support
8.0.0 (2024-10-21)
-
remove deprecated methods
-
update morecantile requirement to
>=5.0,<7.0 -
update rio-tiler requirement to
>=7.0,<8.0 -
update
Infomodel# before class Info(BaseModel): bounds: BBox = Field(default=(-180, -90, 180, 90)) center: Optional[Tuple[float, float, int]] = None minzoom: int = Field(0, ge=0, le=30) maxzoom: int = Field(30, ge=0, le=30) name: Optional[str] = None quadkeys: List[str] = [] tilematrixset: Optional[str] = None # now class Info(BaseModel): bounds: BBox = Field(default=(-180, -90, 180, 90)) crs: str center: Optional[Tuple[float, float, int]] = None name: Optional[str] = None quadkeys: List[str] = [] mosaic_tilematrixset: Optional[str] = None mosaic_minzoom: int = Field(0, ge=0, le=30) mosaic_maxzoom: int = Field(30, ge=0, le=30)
7.2.0 (2024-10-04)
- update BaseBackend to use a default coord_crs from the tms (author @AndrewAnnex, https://github.com/developmentseed/cogeo-mosaic/pull/234)
- add python 3.12 support
- Add tms parameter to cli for MosaicJSON (co-author @AndrewAnnex, https://github.com/developmentseed/cogeo-mosaic/pull/233)
7.1.0 (2023-12-06)
- Automatically remove/add
asset_prefixin Mosaic Backends
7.0.1 (2023-10-17)
- add
py.typedfile (https://peps.python.org/pep-0561)
7.0.0 (2023-07-26)
- update
morecantilerequirement to>=5.0,<6.0 - update
rio-tilerrequirement to>=6.0,<7.0 - update
pydanticrequirement to~=2.0
6.2.0 (2023-07-11)
- add
coord_crstoMosaicBackend.point()method
6.1.0 (2023-07-11)
- add
tilematrixsetinMosaicBackend.info()response
6.0.1 (2023-07-11)
- fix
HttpBackendpost_init method
6.0.0 (2023-07-10)
-
update
morecantile>=4.1,<5.0andrio-tiler>=5.0,<6.0requirements -
replace
supermercadowithsupermorecadoto burn geometries as tiles for different TMS -
update MosaicJSON models to
0.0.3specification (addstilematrixset,asset_type,asset_prefix,data_type,colormapandlayersattributes) -
allow Mosaic creation using other TileMatrixSet (default is still
WebMercatorQuad) -
add
tmssupport to MosaicBackend to read tile in other TMS than the mosaic TileMatrixSet# Before # Mosaic and output Tile in WebMercatorQuad with MosaicBackend("mosaic.json") as mosaic: img, _ = mosaic.tile(0, 0, 0) # Now # Mosaic in WebMercatorQuad (default), output tile in WGS84 WGS1984Quad = morecantile.tms.get("WGS1984Quad") with MosaicBackend("mosaic.json", tms=WGS1984Quad) as mosaic: img, _ = mosaic.tile(0, 0, 0)
5.1.1 (2023-02-06)
- Clip dataset bounds with of TMS bbox (author @lseelenbinder, https://github.com/developmentseed/cogeo-mosaic/pull/200)
5.1.0 (2023-01-20)
- use
az://prefix for private Azure Blob Storage Backend.
5.0.0 (2022-11-21)
- switch from pygeos to shapely>=2.0
4.2.2 (2022-11-19)
- remove useless file in package
4.2.1 (2022-11-15)
- add python 3.11 support
4.2.0 (2022-10-24)
- remove python 3.7 support
- add python 3.10 support
- switch to hatch build-system
- update rio-tiler dependency to >=4.0.0a0
4.1.1 (2022-10-21)
- Add Azure Blob Storage backend (author @christoe, https://github.com/developmentseed/cogeo-mosaic/pull/191)
4.1.0 (2022-02-22)
- remove
mercantileand switch to morecantile>=3.1
4.0.0 (2021-11-30)
- no change since
4.0.0a2
4.0.0a2 (2021-11-22)
- update rio-tiler requirement (
>=3.0.0a6) and update backend reader type information
4.0.0a1 (2021-11-18)
- update rio-tiler requirement (
>=3.0.0a5) - fix
MosaicBackendto match Backend input names.
4.0.0a0 (2021-10-20)
- update morecantile requirement to >= 3.0
- update rio-tiler requirement to >= 3.0 and update Backend's properties
- switch from
requeststohttpx - add
BaseBackend.assets_for_bbox()method (https://github.com/developmentseed/cogeo-mosaic/pull/184)
breaking changes
- remove
BaseBackend.metadata()method (can be replaced byBaseBackend.mosaic_def.dict(exclude={"tiles"})) - remove
cogeo_mosaic.models.Metadatamodel - remove python 3.6 support
BaseBackend.path->BaseBackend.inputattribute (inputwas added in rio-tiler BaseReader)
3.0.2 (2021-07-08)
- Add Google Cloud Storage (
gs://...) mosaic backend (author @AndreaGiardini, https://github.com/developmentseed/cogeo-mosaic/pull/179)
3.0.1 (2021-06-22)
- Make sure to pass an openned file to click.Progressbar (https://github.com/developmentseed/cogeo-mosaic/pull/178)
3.0.0 (2021-05-19)
- update rio-tiler version dependencies
- update pygeos dependency to >=0.10 which fix https://github.com/developmentseed/cogeo-mosaic/issues/81
3.0.0rc2 (2021-02-25)
breaking
gzipis now only applied if the path endswith.gz- remove
backend_optionsattribute in base backends. This attribute was used to pass optionalgzipoption and/or STAC related options - STAC backends has additional attributes (
stac_api_optionsandmosaic_options)
3.0.0rc1 (2021-02-11)
- add
SQLitebackend (https://github.com/developmentseed/cogeo-mosaic/pull/148) - fix cached responsed after updating a mosaic (https://github.com/developmentseed/cogeo-mosaic/pull/148/files#r557020660)
- update mosaicJSON.bounds type definition to match rio-tiler BaseReader definition (https://github.com/developmentseed/cogeo-mosaic/issues/158)
- add default bounds/minzoom/maxzoom values matching the mosaicjson default in the backends (https://github.com/developmentseed/cogeo-mosaic/pull/162)
- raise an error when trying to pass
mosaic_defin read-only backend (https://github.com/developmentseed/cogeo-mosaic/pull/162) - add
MemoryBackend(https://github.com/developmentseed/cogeo-mosaic/pull/163)
breaking
- Updated the backends
.point()methods to return a list in form of[(asset1, values)](https://github.com/developmentseed/cogeo-mosaic/pull/168)
3.0.0b1 (2020-12-18)
- remove
overviewcommand (https://github.com/developmentseed/cogeo-mosaic/issues/71#issuecomment-748265645) - remove
rio-cogeodependencies - update rio-tiler version (
2.0.0rc4)
3.0.0a19 (2020-12-14)
- Update to remove all calls to
rio_tiler.mercatorfunctions.
3.0.0a18 (2020-11-24)
- update Backend base class for rio-tiler 2.0.0rc3 (add
.feature()method)
3.0.0a17 (2020-11-09)
- update for rio-tiler 2.0rc and add backend output models
3.0.0a16 (2020-10-26)
- raise
MosaicNotFoundErrorwhen mosaic doesn't exists in the DynamoDB table.
3.0.0a15 (2020-10-22)
- fix typo in DynamoDB backend (https://github.com/developmentseed/cogeo-mosaic/pull/134)
- rename
cogeo_mosaic/backends/http.py->cogeo_mosaic/backends/web.pyto avoid conflicts (author @kylebarron, https://github.com/developmentseed/cogeo-mosaic/pull/133)
3.0.0a14 (2020-10-22)
- add logger (
cogeo_mosaic.logger.logger) - Update STACBackend to better handler paggination (ref: https://github.com/developmentseed/cogeo-mosaic/pull/125)
- with change from #125,
stac_next_link_keyhas be specified if you know the STAC API is using the latest specs:
with MosaicBackend(
f"stac+{stac_endpoint}",
query.copy(),
11,
14,
backend_options={
"accessor": lambda feature: feature["id"],
"stac_next_link_key": "next",
}
) as mosaic:
- add
to-geojsonCLI to create a GeoJSON from a mosaicJSON document (#128) - refactor internal cache (https://github.com/developmentseed/cogeo-mosaic/pull/131)
- add progressbar for iterating over quadkeys when creating a mosaic (author @kylebarron, https://github.com/developmentseed/cogeo-mosaic/pull/130)
Breaking changes
-
refactored DynamoDB backend to store multiple mosaics in one table (https://github.com/developmentseed/cogeo-mosaic/pull/127)
- new path schema
dynamodb://{REGION}?/{TABLE}:{MOSAIC}
- new path schema
-
renamed exception
MosaicExiststoMosaicExistsError -
renamed option
fetch_quadkeystoquadkeysin DynamoDBBackend.info() method -
add
quadkeysoption inBackends.info()to return (or not) the list of quadkeys (https://github.com/developmentseed/cogeo-mosaic/pull/129) -
moves
get_assetsto the base Backend (https://github.com/developmentseed/cogeo-mosaic/pull/131) -
remove multi_level mosaic support (https://github.com/developmentseed/cogeo-mosaic/issues/122)
3.0.0a13 (2020-10-13)
- add TMS in BaseBackend to align with rio-tiler BaseBackend.
3.0.0a12 (2020-10-07)
- remove pkg_resources (https://github.com/pypa/setuptools/issues/510)
- raise error when
minimum_tile_coveris > 1 (https://github.com/developmentseed/cogeo-mosaic/issues/117) - fix wrong indices sorting in default_filter (https://github.com/developmentseed/cogeo-mosaic/issues/118)
Note: We changed the versioning scheme to {major}.{minor}.{path}{pre}{prenum}
3.0a11 (2020-09-21)
- Raise Exception when trying to overwrite a mosaic (#112)
- Add
reverseoption in.tileand.pointto get values from assets in reversed order.
3.0a10 (2020-08-24)
- Allow PointOutsideBounds exception for
pointmethod (#108)
3.0a9 (2020-08-24)
- BaseBackend.center returns value from the mosaic definition (#105)
3.0a8 (2020-08-21)
- BaseBackend is now a subclass of rio-tiler.io.base.BaseReader (add minzoom, maxzoom, bounds properties and info method)
- use
attrto define backend classes
Breaking changes
backend_optionsis now used to pass options (*kwargs) to the_readmethod
3.0a7 (2020-07-31)
- update to rio-tiler 2.0b5
Breaking changes
- 'value' -> 'values' in MosaicBackend.point output (#98)
3.0a6 (2020-07-31)
- Use environement variable to set/disable cache (#93, autho @geospatial-jeff)
- Allow Threads configuration for overview command (author @kylebarron)
- add --in-memory/--no-in-memory to control temporary files creation for
overviewfunction. - allow pixel_selection method options for
overviewfunction. - update to rio-tiler 2.0b4
- use new COGReader and STACReader to add .tile and .point methods directly in the backends
Breaking changes
- backend.tile -> backend.assets_for_tile
- backend.point -> backend.assets_for_point
3.0a5 (2020-06-29)
- remove FTP from supported backend (#87, author @geospatial-jeff)
- add backend CRUD exceptions (#86, author @geospatial-jeff)
3.0a4 (2020-06-25)
- add STACBackend (#82)
- fix backends caching and switch to TTL cache (#83)
3.0a3 (2020-05-01)
- add Upload CLI (#74, author @kylebarron)
- fix boto3 dynamodb exception (#75)
3.0a2 (2020-05-01)
- Better mosaicJSON model testing and default center from bounds (#73, author @geospatial-jeff)
3.0a1 (2020-05-01)
This is a major version, meaning a lot of refactoring was done and may lead to breaking changes.
- add quadkey_zoom option in CLI (#41, author @kylebarron)
- use R-tree from pygeos for testing intersections (#43, author @kylebarron)
Breaking changes
- added BackendStorage for dynamodb, s3, file and http (with @kylebarron)
- added MosaicJSON pydantic model for internal mosaicjson representation (with @kylebarron and @geospatial-jeff)
2.0.1 (2020-01-28)
- Bug fix, use pygeos from pypi instead of git repo
2.0.0 (2020-01-28) - Major refactor
- remove stack related code (lambda handler, serverless)
- switch to pygeos (#24)
- bug fixes
- add
lastpixel_method
1.0.0 (2019-12-13)
- add tif output
- fix overview creation
- add other Web templates
0.3.0 (2019-11-07)
- use aws lambda layer
- add
update_mosaicutility function - add
/tiles/pointendpoint to get points values from a mosaic - add logs for mosaic creation
- add custom pixel methods
- add custom color maps
Breaking changes
- rename
/mosaic/info/<mosaicid>to/mosaic/<mosaicid>/info
0.2.0 (2019-09-30)
- update for lambda-proxy~=5.0 (#15)
- add
minimum_tile_coveroption for mosaic creation (#16) - add
tile_cover_sortoption (#16) - add verbosity for cli
0.1.0 (2019-09-05)
- add /create.html endpoint (#14)
- update to remotepixel/amazonlinux docker image
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cogeo_mosaic-9.1.0.tar.gz.
File metadata
- Download URL: cogeo_mosaic-9.1.0.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.14.2 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2102e68d3b1e7ee987ea85137ac198bf2f49d83739e4251a30265f4d5436828
|
|
| MD5 |
3c80d6966b0937db2d9cb688a0375494
|
|
| BLAKE2b-256 |
8848614f53add12c39c86ac392a365f74c13bcea31d8e8cac4c2ccdb1d9f5cc3
|
File details
Details for the file cogeo_mosaic-9.1.0-py3-none-any.whl.
File metadata
- Download URL: cogeo_mosaic-9.1.0-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.14.2 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b246182f12ae25d562ebc86987d2736617216e94a6a5d202460220faf7afc0d7
|
|
| MD5 |
8e5f74d6271963b7371353911ef48321
|
|
| BLAKE2b-256 |
981abe72e2cb8e1f14611d968da99c3689049637de367ed8f8c01132a2c3861e
|