Skip to content

Commit

Permalink
chore(release): v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jahed authored Sep 10, 2024
1 parent 6b35349 commit abf0cd5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DESCRIPTION
Converts an image to map tiles to be used in Google Maps, Leaflet and other
map rendering software.

Version: v3.0.0
Version: v4.0.0
Homepage: https://github.com/jahed/maptiles
Donate: https://jahed.dev/donate

Expand All @@ -29,41 +29,45 @@ OPTIONS

-o, --optimise (lossy|lossless)
Optimises tiles depending on the <format>.

* 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 <input_image> into a square one, using whichever
dimension is largest and centering the image.

-j, --json <base>
Creates a TileJSON v2.2.0 file. <base> is used to create the tiles URL:
<base><output_directory>/{z}/{x}/{y}.<format>
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 version.
Prints the name and version.

OUTPUT
Tiles in the <output_directory> will take the format of:
<output_directory>/{zoom_level}/tile_{x}_{y}.<format>
<output_directory>/{z}/{x}/{y}.<format>

{zoom_level} will start at 0 and go up to the maximum zoom possible for the
{z} will start at 0 and go up to the maximum zoom possible for the
<input_image> rounding up to the next zoom level. An <input_image> 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 {zoom_level} goes up in
dimensions of 2 to the power of {zoom_level} (i.e. 1x1, 2x2, 4x4, 8x8, etc.).
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.
download larger, low quality, upscaled tiles. Alternatively, use the TileJSON.

EXAMPLES
Take a detailed image and create optimised tiles to save space.
Expand All @@ -83,7 +87,7 @@ DEPENDENCIES
jpegtran https://jpegclub.org/jpegtran/

COPYRIGHT
Copyright (C) 2020 Jahed Ahmed
Copyright (C) 2024 Jahed Ahmed

This 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
Expand Down
2 changes: 1 addition & 1 deletion maptiles
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eo pipefail

name="maptiles"
version="v3.0.0"
version="v4.0.0"

function print_help {
cat <<EOF
Expand Down

0 comments on commit abf0cd5

Please sign in to comment.