Skip to content

A Kotlin library to fetch and rename OSM tiles for further usage.

License

Notifications You must be signed in to change notification settings

feczkob/osm-tile-manager

Repository files navigation

OSM Tile Manager

OSM Tile Manager is a Kotlin application that allows you to download map tiles from a specified area and range of zoom levels as .png pictures. The downloaded tiles follow the /zoom/x/y convention, making them compatible with various mapping libraries and applications (e.g. MapCompose).

Please consider the OpenStreetMap tile usage policy and the OSM Wiki Downloading data before using this application. Download the tiles responsibly and avoid overloading the OSM servers.

Features

  • Download map tiles from a specified area with a range of zoom levels
  • Rename downloaded directories and tiles to follow the convention used in MapCompose

Installation

  1. Clone the repository:

    git clone [email protected]:feczkob/osm-tile-manager.git
  2. Navigate to the project directory:

    cd osm-tile-manager
  3. Create a .env file in the root of the project and set the following parameters. Replace the values with the appropriate path, coordinates of the desired area and zoom level(s). See .env.example for an example.

    TILES_PATH=/your/path/to/the/tiles/folder
    TOP_LEFT_LAT=47.5189
    TOP_LEFT_LON=19.0129
    BOTTOM_RIGHT_LAT=47.4724
    BOTTOM_RIGHT_LON=19.0829
    MIN_ZOOM=13
    MAX_ZOOM=14
    
  4. Build the project:

    ./gradlew clean build

Usage

Tile Download

To download the tiles,

  1. execute the following command:

    ./gradlew fetchTiles

    or

  2. run the main() method in the GenerateTiles.kt file.

Verify that the tiles have been downloaded in the specified directory. The fetched tiles cover the specified area (given in the .env file), and the same area is downloaded on all zoom levels. The coordinates of the specified area and the one being fetched are usually different. Read the README.md file next to the tiles for more information.

Tile Renaming

To rename the downloaded tiles,

  1. execute the following command:

    ./gradlew renameTiles

    or

  2. run the main() method in the RenameTiles.kt file.

Verify that the previously downloaded tiles have been renamed according to the specified convention.

About

A Kotlin library to fetch and rename OSM tiles for further usage.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages