{"id":28957096,"url":"https://github.com/developmentseed/mosaicjson-spec","last_synced_at":"2025-06-23T21:41:31.960Z","repository":{"id":45735760,"uuid":"177810766","full_name":"developmentseed/mosaicjson-spec","owner":"developmentseed","description":"JSON format for describing SpatioTemporal Cloud Optimized Geotiff mosaic.","archived":false,"fork":false,"pushed_at":"2023-06-03T20:43:00.000Z","size":23,"stargazers_count":73,"open_issues_count":1,"forks_count":6,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-04-10T03:11:37.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developmentseed.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-03-26T14:56:40.000Z","updated_at":"2024-04-02T14:25:26.000Z","dependencies_parsed_at":"2022-08-05T03:00:36.442Z","dependency_job_id":"3a3421a5-bbca-47bd-9ddf-119af8456194","html_url":"https://github.com/developmentseed/mosaicjson-spec","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/developmentseed/mosaicjson-spec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fmosaicjson-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fmosaicjson-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fmosaicjson-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fmosaicjson-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developmentseed","download_url":"https://codeload.github.com/developmentseed/mosaicjson-spec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fmosaicjson-spec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561352,"owners_count":23177586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-23T21:41:27.804Z","updated_at":"2025-06-23T21:41:31.938Z","avatar_url":"https://github.com/developmentseed.png","language":null,"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/10407788/72360020-5a4dfa00-36bd-11ea-9fdd-18ddf51693b8.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eMosaicJSON is an open standard for representing\nmetadata about a mosaic of \u003cb\u003eAssets\u003c/b\u003e (e.g Cloud Optimized GeoTIFF).\u003c/em\u003e\n\u003c/p\u003e\n\n---\n\n**Blog Post**: https://medium.com/devseed/cog-talk-part-2-mosaics-bbbf474e66df\n\n**Source Code**: \u003ca href=\"https://github.com/developmentseed/mosaicjson-spec\" target=\"_blank\"\u003ehttps://github.com/developmentseed/mosaicjson-spec\u003c/a\u003e\n\n---\n\n## Description\n\n![](https://user-images.githubusercontent.com/10407788/68706772-7539ac00-055e-11ea-8c15-5ee4f30b143e.jpg)\n\nMosaicJSON can be seen as a Virtual raster (see GDAL's [VRT](https://gdal.org/drivers/raster/vrt.html)) enabling spatial and temporal processing for a list of **Assets**.\n\n## Features\n\n- simple **JSON** format (enabling high ratio compression)\n- **quadkey** based file index\n\n## Implementations\n\n![](https://user-images.githubusercontent.com/10407788/69247339-42a03c80-0b78-11ea-913a-e0e407576427.png)\n[cogeo-mosaic](https://github.com/developmentseed/cogeo-mosaic)\n\n## API Example\n\u003cdetails\u003e\n\n\n```python\ndef fetch_mosaic_definition(url: Union[str, Path]) -\u003e Dict:\n    \"\"\"Fetch mosaic definition file.\"\"\"\n    ...\n    return mosaic_definition\n\n\ndef _fetch_and_find_asset(url: str, x: int, y: int, z: int):\n    mdef = fetch_mosaic_definition(url)\n    return get_assets(mdef, x: int, y: int, z: int)\n\n\ndef get_assets(mosaic_definition: Dict, x: int, y: int, z: int) -\u003e list[str]:\n    \"\"\"Get asset list for a Z/X/Y index and a mosaic definition.\n\n    Parameters\n    ----------\n    mosaic_definition : dict\n        mosaic definition content.\n    x : int\n        Mercator tile X index.\n    y : int\n        Mercator tile Y index.\n    z : int\n        Mercator tile ZOOM level.\n\n    Returns\n    -------\n    assets : list\n        list of assets intersecting with the tile index.\n\n    \"\"\"\n    min_zoom = mosaic_definition[\"minzoom\"]\n\n    mercator_tile = mercantile.Tile(x=x, y=y, z=z)\n    quadkey_zoom = mosaic_definition.get(\"quadkey_zoom\", min_zoom)  # 0.0.2\n\n    # get parent\n    if mercator_tile.z \u003e quadkey_zoom:\n        depth = mercator_tile.z - quadkey_zoom\n        for i in range(depth):\n            mercator_tile = mercantile.parent(mercator_tile)\n        quadkey = [mercantile.quadkey(*mercator_tile)]\n\n    # get child\n    elif mercator_tile.z \u003c quadkey_zoom:\n        depth = quadkey_zoom - mercator_tile.z\n        mercator_tiles = [mercator_tile]\n        for i in range(depth):\n            mercator_tiles = sum([mercantile.children(t) for t in mercator_tiles], [])\n\n        mercator_tiles = list(filter(lambda t: t.z == quadkey_zoom, mercator_tiles))\n        quadkey = [mercantile.quadkey(*tile) for tile in mercator_tiles]\n    else:\n        quadkey = [mercantile.quadkey(*mercator_tile)]\n\n    assets = list(\n        itertools.chain.from_iterable(\n            [mosaic_definition[\"tiles\"].get(qk, []) for qk in quadkey]\n        )\n    )\n\n    # check if we have a mosaic in the url (.json/.gz)\n    return list(\n        itertools.chain.from_iterable(\n            [\n                fetch_and_find_assets(asset, x, y, z)\n                if os.path.splitext(asset)[1] in [\".json\", \".gz\"]\n                else [asset]\n                for asset in assets\n            ]\n        )\n    )\n```\n\n\u003c/details\u003e\n\n## License\n\nThe text of this specification is licensed under the\n[MIT License](https://github.com/developmentseed/mosaicjson-spec/blob/main/LICENSE).\nThe use of this spec in products and code is entirely free:\nthere are no royalties, restrictions, or requirements.\n\n## Authors\n\n* Vincent Sarago\n* Sean Harkins\n* Drew Bollinger\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fmosaicjson-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmentseed%2Fmosaicjson-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fmosaicjson-spec/lists"}