{"id":13538879,"url":"https://github.com/commenthol/gdal2tiles-leaflet","last_synced_at":"2025-04-05T07:03:16.194Z","repository":{"id":26646848,"uuid":"30102907","full_name":"commenthol/gdal2tiles-leaflet","owner":"commenthol","description":"Generate raster image tiles for use with leaflet.","archived":false,"fork":false,"pushed_at":"2021-10-30T10:44:22.000Z","size":60772,"stargazers_count":490,"open_issues_count":5,"forks_count":131,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-29T06:03:30.490Z","etag":null,"topics":["coordinates","leaflet","raster","tile-generator"],"latest_commit_sha":null,"homepage":"https://commenthol.github.io/leaflet-rastercoords/","language":"Python","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/commenthol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-31T05:07:13.000Z","updated_at":"2025-03-25T09:23:07.000Z","dependencies_parsed_at":"2022-07-13T08:31:11.234Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/gdal2tiles-leaflet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fgdal2tiles-leaflet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fgdal2tiles-leaflet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fgdal2tiles-leaflet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fgdal2tiles-leaflet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/gdal2tiles-leaflet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299831,"owners_count":20916190,"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":["coordinates","leaflet","raster","tile-generator"],"created_at":"2024-08-01T09:01:17.259Z","updated_at":"2025-04-05T07:03:16.151Z","avatar_url":"https://github.com/commenthol.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# gdal2tiles-leaflet\n\n\u003e Generate raster image tiles for use with leaflet.\n\n[Example][example] in action.\n\nThis is a modified version of [gdal2tiles.py][] which adds support for raster images as plain 2D maps in [leafletjs][].\n\nIt adds the option `-l` or `--leaflet` to generate the resulting images with the reference point `[0,0]` in the upper-left (North-West) corner, opposed to the standard behaviour for TMS tiles using the lower-left (South-East) corner.\n\nTogether with the small [leafletjs][] plugin [leaflet-rastercoords][] you'll be able to add markers at the correct position using the (x, y) coordinates of the full-size image.\n\n## Prerequisites\n\nOn Debian style OS:\n\n    sudo apt install python-gdal\n\nfor python3\n\n    sudo apt install python3-gdal\n\nfor others give your search-engine a try...\n\n## Basic usage\n\n````\n$ gdal2tiles.py -l -p raster -z 0-5 -w none \u003cimage\u003e \u003ctilesdir\u003e\n````\n\nCheck [test/createtiles.sh](test/createtiles.sh) for usage.\n\nIf the `-z` option is omitted then the tool considers the min. zoom level otherwise note...\n\n**Note:** The min zoom level for tile generation must be greater or\nequal to `log2(max(width, height)/tilesize)`\n\nAssuming an image with 2000x3000 pixels:\n\n````\n# take the larger dimension -\u003e here height = 3000px\n$ echo \"l(3000/256)/l(2)\" | bc -l\n# 3.55 --\u003e min zoomlevel for tile generation is 4\n# means: `gdal2tiles.py -l -p raster -z 0-2 ...`\n#                                          \\__ is not allowed\n# correct usage\n$ gdal2tiles -l -p raster -z 0-4 ...\n````\n\n## Multicore usage\n\nThe same works with multicore support, thanks to [gdal2tiles-Ticket-4379][].\n\n````\n$ gdal2tiles-multiprocess.py -l -p raster -z 0-5 -w none \u003cimage\u003e \u003ctilesdir\u003e\n````\n\n## Usage with Leaflet\n\nTo use the generated tiles with Leaflet there is a small plugin to correctly set the required projection for raster images.\nPlease refer to the documention at [leaflet-rastercoords][].\n\n## Example\n\nTo run the example you'll need to generate the tiles for the large image first.\n\n````\n$ cd test\n$ ./createtiles.sh\n$ open index.html\n````\n\nThen open `index.html` in a browser.\n\n[![The sample in test](test.png)][example]\n\nOr see it [here][example] in action.\n\n## Contribution and License Agreement\n\nIf you contribute code to this project, you are implicitly allowing your\ncode to be distributed under the respective license. You are also implicitly\nverifying that all code is your original work or correctly attributed\nwith the source of its origin and licence.\n\n## License\n\nModifications and samples are [MIT licensed][LICENSE].\n\n[gdal2tiles.py][]: (MIT licensed)\n* Copyright (c) 2008, Klokan Petr Pridal\n* Copyright (c) 2010-2013, Even Rouault\n\n## References\n\n\u003c!-- !ref --\u003e\n\n* [/gdal-1.11.1/swig/python/scripts/gdal2tiles.py][gdal2tiles.py]\n* [example][example]\n* [gdal2tiles-Ticket-4379][gdal2tiles-Ticket-4379]\n* [leaflet-rastercoords][leaflet-rastercoords]\n* [leafletjs][leafletjs]\n* [LICENSE][LICENSE]\n\n\u003c!-- ref! --\u003e\n\n[LICENSE]: ./LICENSE\n[leafletjs]: http://leafletjs.com\n[leaflet-rastercoords]: https://github.com/commenthol/leaflet-rastercoords\n[gdal2tiles.py]: http://download.osgeo.org/gdal/1.11.1/gdal-1.11.1.tar.gz \"/gdal-1.11.1/swig/python/scripts/gdal2tiles.py\"\n[gdal2tiles-Ticket-4379]: http://trac.osgeo.org/gdal/ticket/4379\n[example]: https://commenthol.github.io/leaflet-rastercoords/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fgdal2tiles-leaflet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fgdal2tiles-leaflet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fgdal2tiles-leaflet/lists"}