Code Monkey home page Code Monkey logo

tiler's Introduction



A no nonsense Vector Tile pipeline

The purpose of Tiler is to create an easy to use, command line orientied pipeline for taking vector data in formats such as Shapefiles, and transforming them into raw Vector Tiles and MBTiles files (if required).

Tiler exists as a Docker container that unifies several technologies to streamline the creation of vector tiles.

CircleCI Badge

Setup

Setup requires installation of Docker and a few Docker commands to get started. We've provided a nice little set of instructions in the SETUP file.

Using Tiler

Tiler provides a selection of scripts for converting between various formats and validating them (see the tiler-scripts folder). The primary and simplest way to use Tiler however is to use a config file placed in tiler-data/configs:

{

    "outdir" : "/tiler-data/tiles/",
    "tileset" : "states",
    "simplification" : 5,
    "data" : {

        "states" : {
            "type" : "shapefile",
            "paths" : ["/tiler-data/test-data/states/states.shp"],
            "minzoom" : 0,
            "maxzoom" : 5
        },

        "capitals" : {
            "type" : "postgis",
            "query" : "select * from capitals"
            "minzoom" : 2,
            "maxzoom" : 10
        }

    }

}

This would be saved as tiler-data/configs/states.tiler.json. The file provides the location of the files you wish to translate, along with the output directory and if you want any simplification to occur. "data" is an object full of layers you wish to be ingested into the tiles. In this case the layer has multiple files that they use to generate that layer ("paths"). You can also provide a minimum zoom ("minzoom") and a maximum zoom ("maxzoom") for each layer.

At the moment "type" can be shapefile or geojson and postgis. Future intergrations will potentially include gml and other common standards.

Once your config file is setup, and you have followed the setup instructions you can run:

./run.sh states

To generate the set of uncompressed vector tiles and an .mbtiles file.

Tests

Running Tests

A set of tests are provided that can be run using nosetest.

./run.sh --test

Vector Tile Demo

A worked example; we could run the states config file as such:

./run.sh states

After having ran this, there would be a set of states tiles in the tiler-data/tiles/states directory. You can then run a web server (i.e. python -m SimpleHTTPServer or live-server) from the host, with the tiler directory as the root. You can then navigate to the demos folder to try out those demo pages.

Demos are provided using Leaflet.VectorGrid and also Mapbox GL for you to display your tiles when you're done. You will need to specify your own styling in these examples.

Roadmap

Check out the roadmap here

Credits

This project was made possible thanks to building on a fantastic set of previous previous software:

License

MIT License

tiler's People

Contributors

jameslmilner avatar klaash avatar

Watchers

 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.