Code Monkey home page Code Monkey logo

tm2's Introduction

TM2 (development)

Experimental version of TileMill powered by vector tiles. There are currently no supported releases of this software.

What are vector tiles?

Vector tiles are the vector data equivalent of image tiles for web mapping. They apply the strengths of tiling -- developed for caching, scaling and serving map imagery rapidly -- to vector data. Consider an image tile at the zxy coordinate 14/4823/6160. This image is a PNG that depicts the corner of lower Manhattan with roads, building footprints, and parks:

http://a.tiles.mapbox.com/v3/examples.map-zr0njcqy/14/4823/6160.png

A vector tile at 14/4823/6160 would contain all the corresponding geometries and metadata -- like road names, area types, building heights -- in a compact, parsable format. Vector tiles are a highly performant format that provide greater flexibility in terms of styling, output format, and interactivity.

               +----------+   +----------+
               |          |   |          |
               |  vector  |   | cartocss |
               |   tile   +-+-+  styles  |
               |          | | |          |
               +----------+ | +----------+
                            v
                     +-------------+
                     |             |
                     |  renderer   |
                     |             |
                     +------+------+
                            |
     +---------------+------+------+---------------+
     |               |             |               |
+----v-----+   +-----v----+   +----v-----+   +-----v----+
|          |   |          |   |          |   |          |
| geojson  |   | png tile |   | utf tile |   |  ??????  |
|          |   |          |   |          |   |          |
+----------+   +----------+   +----------+   +----------+

Vector tiles are designed to use the same tiling and coordinate scheme used by image tiles and take full advantage of HTTP. CDN caching, high scalability and efficient distribution make vector tiles a much more attractive solution than running, say, a enormous cluster of database and application servers that respond to queries on demand.

Here are some rough details of our implementation at time of writing:

  • Vector tiles are Protocol Buffers, a compact binary format for transferring messages.
  • Vector tiles store a serialized version of the internal data that Mapnik uses when rendering maps.
  • Vector tiles are organized into layers (e.g. roads, water, areas), which contain individual features each with a geometry and variable number of attributes per layer(e.g. name, type, etc.).

TM2 architecture

TM2 ships with an example vector tile source: MapBox Streets. When you create your first project you will have full access to style curated data from OpenStreetMap without setting up PostGIS, downloading and importing a large planet database file, or any of the other steps usually taken to work with OpenStreetMap data. If you have been working on styles for streets in London and want to check how well your styles apply to data in Paris, TM2 will download the vector tiles on-the-fly as you pan over to France. TM2 caches downloaded vector tiles to an MBTiles database on disk so that you can take your work offline in a limited fashion.

Unlike TileMill, TM2 makes a hard split between two types of packages:

  • Styles contain stylesheets, basic thin metadata (name, description, attribution, etc.), and a reference to a datasource.
  • Sources describe a source for vector tiles, for example a URL endpoint from which to download tiles. We also have an API for generating vector tiles on the fly from traditional Mapnik datasources (shapefiles, postgis, etc) -- see tilelive-bridge for more info.

TM2 focuses on editing Styles, but there is also an early UI for working with Sources.

Building TM2

Dependencies are:

  • Mapnik v2.2.0
  • Node.js v0.8.x or v0.10.x
  • Protobuf compiler and libprotobuf-lite

Mac OS X

Binary

Bleeding edge binary builds are available for OS X at http://tilemill.s3.amazonaws.com/index.html?path=dev/. Follow the instructions below to install from source if you are interested in developing on TM2.

Source install

First update your homebrew to ensure that the recently released Mapnik v2.2.0 is available:

brew update

Then install/upgrade mapnik, node, and libprotobuf with homebrew:

brew install mapnik || brew upgrade mapnik
brew install node || brew upgrade node
brew install protobuf || brew upgrade protobuf

Note: you can also install node via the easy installer available at http://nodejs.org/download.

Finally install and run TileMill 2:

git clone https://github.com/mapbox/tm2.git
cd tm2
npm install
node index.js

Ubuntu Linux

Warning: TM2 depends on a Mapnik version that is not compatible with the existing Mapnik that will have been installed by the TileMill 0.10.x package. It is not recommended to try to run both TileMill and TM2 on the same linux machine.

sudo apt-get install python-software-properties
echo 'Yes' | sudo apt-add-repository ppa:chris-lea/node.js
echo 'Yes' | sudo add-apt-repository ppa:mapnik/v2.2.0
sudo apt-get update -y
sudo apt-get install -y nodejs protobuf-compiler libprotobuf-lite7 libprotobuf-dev libmapnik libmapnik-dev make

git clone https://github.com/mapbox/tm2.git
cd tm2
npm install
node index.js

tm2's People

Contributors

adrianrego avatar ajashton avatar crofty avatar lonnygomes avatar yhahn avatar

Stargazers

 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.