GithubHelp home page GithubHelp logo

dalalsunil1986 / im-map-tiles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rmitula/im-map-tiles

0.0 0.0 0.0 6 KB

Map Tile Generator for Google Maps, Leaflet and other Map libraries using ImageMagick

License: MIT License

Shell 100.00%

im-map-tiles's Introduction

im-map-tiles

Map Tile Generator for Google Maps, Leaflet and other Map libraries using ImageMagick.

Discord Chat Patreon

Dependencies

Usage

$ ./im-map-tiles.sh 
Usage: ./im-map-tiles.sh SOURCE_IMAGE TILES_DESTINATION_DIR [TILE_FORMAT]

SOURCE_IMAGE must exist.
TILE_FORMAT defaults to 'png'.

Output will take the format of:

${TILES_DESTINATION_DIR}/${ZOOM_LEVEL}/tile_${X}_${Y}.${TILE_FORMAT}

e.g.

./tiles/1/tile_0_1.png
./tiles/3/tile_2_3.png
./tiles/5/tile_2_3.png
...

${ZOOM_LEVEL} will start at 0 and go up to the maximum zoom possible for the ${SOURCE_IMAGE} rounding up to the next zoom level. A ${SOURCE_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^${ZOOM_LEVEL} (i.e. 1x1, 2x2, 4x4, 8x8, 16x16 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.

If a ${ZOOM_LEVEL} directory already exists, it will be skipped.

License

MIT

im-map-tiles's People

Contributors

jahed avatar twista avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.