#tile #tilemap #map #versatiles #mbtiles #format

versatiles_geometry

A toolbox for converting, checking and serving map tiles in various formats

17 unstable releases (3 breaking)

new 0.14.2 Nov 24, 2024
0.13.0 Oct 30, 2024
0.12.4 Jul 22, 2024

#251 in Geospatial

Download history 153/week @ 2024-08-04 22/week @ 2024-08-11 14/week @ 2024-08-18 23/week @ 2024-08-25 14/week @ 2024-09-01 8/week @ 2024-09-08 187/week @ 2024-09-15 52/week @ 2024-09-22 407/week @ 2024-09-29 29/week @ 2024-10-06 11/week @ 2024-10-13 284/week @ 2024-10-20 183/week @ 2024-10-27 19/week @ 2024-11-03 191/week @ 2024-11-10 66/week @ 2024-11-17

476 downloads per month
Used in 6 crates (2 directly)

MIT license

335KB
9K SLoC

Crates.io Crates.io Code Coverage GitHub Workflow Status (with event) License Matrix Chat

Table of contents:

VersaTiles

VersaTiles is a Rust-based project designed for processing and serving tile data efficiently. It supports multiple tile formats and offers various functionalities for handling tile data.

Installation

Linux

Use the installation script to download the correct precompiled binary and copy it to /usr/local/bin/:

curl -Ls "https://github.com/versatiles-org/versatiles-rs/raw/main/helpers/install-unix.sh" | bash

MacOS

Install VersaTiles using Homebrew:

brew tap versatiles-org/versatiles
brew install versatiles

NixOS

VersaTiles is available via nixpkgs beginning with 24.05. An up to date version is part of nixpkgs-unstable.
For installation add following snippet into your configuration.nix:

environment.systemPackages = with pkgs; [ versatiles ];

You can also use versatiles via shell environments:

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    versatiles
  ];

}

Additional information can be found at Nix search.

Docker

Pull the prepared Docker Images for easy deployment:

docker pull versatiles-org/versatiles

Building locally using cargo install

You need Rust. Just run:

cargo install versatiles

Building from source

Ensure you have Rust installed. Then, run:

git clone https://github.com/versatiles-org/versatiles-rs.git
cd versatiles-rs
cargo build --bin versatiles --release
cp ./target/release/versatiles /usr/local/bin/

Usage

Running the versatiles command will list all available commands:

Usage: versatiles [OPTIONS] <COMMAND>

Commands:
  convert  Convert between different tile containers
  probe    Show information about a tile container
  serve    Serve tiles via http
  help     Show detailed help

Example: Convert Tiles

Convert between different tile formats:

versatiles convert --tile-format webp satellite_tiles.tar satellite_tiles.versatiles

Example: Serve Tiles

Serve tiles via HTTP:

versatiles serve satellite_tiles.versatiles

Repository Structure

Code

  • /versatiles/ - Main library and binary.
  • /versatiles_container/ - Reading and writing tile containers like *.versatiles, *.mbtiles, *.pmtiles, etc.
  • /versatiles_core/ - Core data types, utilities, and macros.
  • /versatiles_derive/ - Handles derive macros.
  • /versatiles_geometry/ - Manages geometry data, including OSM data, GeoJSON, vector tiles, etc.
  • /versatiles_image/ - Handles image data (PNG, JPEG, WEBP) and image processing.
  • /versatiles_pipeline/ - Manages "VersaTiles Pipelines" for fast tile processing.

Helpers

  • /docker/ - Contains a Dockerfile for building Linux binaries.
  • /helpers/ - Shell scripts for checking, building, and releasing.
  • /testdata/ - Files used during testing.

Additional Information

For more details, guides, and advanced usage, please refer to the official documentation.

Development and Contribution

VersaTiles is under active development, and the documentation may not always be up to date. We appreciate your understanding and patience. If you encounter any issues or have questions, feel free to open an issue or contribute to our code or documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~17–29MB
~580K SLoC