Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jahed/maptiles
Map tile generator. Converts an image into map tiles using ImageMagick. Map tiles can be used in Google Maps, Leaflet, FrontierNav, and other map rendering software.
https://github.com/jahed/maptiles
bash frontiernav imagemagick leaflet map map-tiles mapping maps openlayers
Last synced: 6 days ago
JSON representation
Map tile generator. Converts an image into map tiles using ImageMagick. Map tiles can be used in Google Maps, Leaflet, FrontierNav, and other map rendering software.
- Host: GitHub
- URL: https://github.com/jahed/maptiles
- Owner: jahed
- License: agpl-3.0
- Created: 2016-02-03T15:25:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T03:41:13.000Z (about 2 months ago)
- Last Synced: 2024-10-23T13:36:04.214Z (14 days ago)
- Topics: bash, frontiernav, imagemagick, leaflet, map, map-tiles, mapping, maps, openlayers
- Language: Shell
- Homepage: https://jahed.dev
- Size: 165 KB
- Stars: 74
- Watchers: 4
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
NAME
maptiles - converts an image to map tilesSYNOPSIS
./maptiles []DESCRIPTION
Converts an image to map tiles to be used in Google Maps, Leaflet and other
map rendering software.Version: v4.0.1
Homepage: https://github.com/jahed/maptiles
Donate: https://jahed.dev/donateOPTIONS
Image to convert into tiles. Must exist. Must be square, otherwise
see --square option.
Output directory. Must NOT exist, to avoid polluting existing directories.-f, --format
Tile format (e.g. 'png'). Defaults to file extension.-b, --background
Can be any ImageMagick-compatible colour. Defaults to 'none' (transparent).
See: https://imagemagick.org/script/color.php-o, --optimise (lossy|lossless)
Optimises tiles depending on the .
* png uses pngquant (lossy) or optipng (lossless)
* jpg uses jpegtran (lossless)
Lossy optimisations may cause a size increase depending on each tile's
complexity. Only use it for maps which store a lot of detail per tile.-s, --square
Converts a non-square into a square one, using whichever
dimension is largest and centering the image.-j, --json
Creates a TileJSON v2.2.0 file. is used to create the tiles URL:
/{z}/{x}/{y}.
Use a placeholder such as '{b}' or '' to complete the URL later.
See: https://github.com/mapbox/tilejson-spec/tree/master/2.2.0-h, --help
Prints this help message.--version
Prints the name and version.OUTPUT
Tiles in the will take the format of:
/{z}/{x}/{y}.{z} will start at 0 and go up to the maximum zoom possible for the
rounding up to the next zoom level. An with
dimensions 2048x2048 will go up to 4 whereas an image with 3000x3000 will go
up to 5. This is done to make the most out of the level of detail in the image
without enlargening too much.Each tile has a dimension of 256x256 and each {z} goes up in
dimensions of 2 to the power of {z} (i.e. 1x1, 2x2, 4x4, 8x8, etc.).
So overall, for each zoom level, the resulting map resolution will be 256x256,
512x512, 1024x1024, 2048x2048 and so on.If you're using Leaflet, I suggest you set this maximum zoom as your
map.maxNativeZoom so you can have higher zoom levels without the need to
download larger, low quality, upscaled tiles. Alternatively, use the TileJSON.EXAMPLES
Take a detailed image and create optimised tiles to save space.
./maptiles detailed_map.png --optimise lossy ./tilesTake an image, square it with a red background and output it as JPG tiles.
./maptiles map.png --square --format jpg --background #ff0000 ./tilesDEPENDENCIES
Required
ImageMagick https://www.imagemagick.org
Bash https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29Optional
pngquant https://pngquant.org/
optipng http://optipng.sourceforge.net/
jpegtran https://jpegclub.org/jpegtran/COPYRIGHT
Copyright (C) 2024 Jahed AhmedThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .