Mapzen vector tile service - OpenStreetMap data in several formats
Latest commit 60374e2 Sep 21, 2018
Permalink
Failed to load latest commit information.
.circleci Explain double sudo. Aug 30, 2018
data Run ST_MakeValid on geometries after mercator projection in ne_10m_oc… Aug 22, 2018
docs final PR comments Sep 21, 2018
integration-test Remove duplicate UTF-8 encoding comments. Aug 29, 2018
queries Add explanatory comment for confusing 'admin_leve' column. Jul 10, 2018
scripts Bumped up obelisk priority over artwork. Made min zoom depend on the … Jun 28, 2018
spreadsheets Add support for min zoom defaults for regions based on the country th… Jun 15, 2018
test Protect against misuse of None when splitting ref. Aug 22, 2018
tilejson Add nightclubs Dec 16, 2017
vectordatasource Merge pull request #1565 from tilezen/zerebubuth/1562-australia-shiel… Aug 24, 2018
yaml Fix syntax of YAML to make sure it's a valid SQL string. Jul 2, 2018
.dockerignore Ignore pre-built stuff and properly build the docker image Nov 15, 2017
.gitignore Update curated shapefiles. Dec 1, 2017
CHANGELOG.md fix issue link Sep 21, 2018
CONTRIBUTING.md Add information about migrations to CONTRIBUTING.md Nov 22, 2017
Dockerfile Ignore pre-built stuff and properly build the docker image Nov 15, 2017
ISSUE_TEMPLATE.md Update ISSUE_TEMPLATE.md Mar 3, 2016
LICENSE add license May 29, 2015
MANIFEST.in Include VERSION file in package Oct 23, 2017
PERFORMANCE.md Add some basic performance recommendations Dec 4, 2017
PULL_REQUEST_TEMPLATE.md add data migrations to PR template Jul 19, 2016
README.md Fix a few URLs Jul 18, 2017
SEMANTIC-VERSIONING.md Correct Greek (modern) language code to el from gr Jan 10, 2018
TESTS.md Merge pull request #1489 from tilezen/whosonfirst Apr 20, 2018
VERSION Version bump -> v1.4.3 Jan 8, 2018
config.dev.yaml Rename to config.dev.yaml Nov 21, 2017
osm2pgsql.style Way area needs to be a column. Aug 2, 2016
queries.yaml Strip country_code from roads. Jun 18, 2018
requirements.txt Update all packages to the latest versions. Nov 8, 2017
setup.py Add shapefile library, used for shapefile-based fixtures. Aug 30, 2017
test-data-osm-template.xsl add script to import missing OSM features, from MattA Apr 25, 2016
test-data-update-osm.sh Make Natural Earth roads start at zoom 5 Aug 1, 2017
test_config.example.yaml update URLs to new prod pattern tile.mapzen.com Oct 13, 2016

README.md

Mapzen Vector Tiles

The Mapzen vector tile service provides worldwide basemap coverage sourced from OpenStreetMap and other open data projects, updated daily.

Gitter

Quick links

Contents of an example vector tile

Vector tiles are square-shaped collections of geographic data that contain the map feature geometry, such as lines and points. Information about how map features are drawn is maintained in a separate stylesheet file.

For many purposes, vector tiles are more flexible than raster tiles, which are images that already have the visual appearance of the map features pre-drawn. With vector tiles, there is no need to head back to the server and fetch a different set of tiles if you want to filter the output or change the style of a road or color of a building.

Vector tiles make real-time rendering possible by sending the underlying data geometry and tags directly to the client, whether that’s a browser or a native mobile app. Buildings and roads can be rendered in different ways, or not at all, when the vector tile is downloaded, and changes happen instantly on the client's side.

With vector tiles you have the power to customize the content and visual appearance of the map. We're excited to see what you build!

Use Mapzen's Vector Tile Service

To start integrating vector tiles to your app, you need a developer API key. API keys come in the pattern: vector-tiles-xxxxxxx.

Requesting tiles

The URL pattern to request tiles is:

https://tile.mapzen.com/mapzen/vector/v1/{layers}/{z}/{x}/{y}.{format}?api_key=vector-tiles-xxxxxxx

Here’s a sample tile in TopoJSON:

https://tile.mapzen.com/mapzen/vector/v1/all/16/19293/24641.topojson?api_key=vector-tiles-xxxxxxx

More information is available about how to use the vector tile service and specify custom layers in the service (though we recommend the default all layer).

Formats

The Mapzen vector tile stack provides tiles in a variety of formats (service docs):

  • Mapbox Vector Tile: use the .mvt extension. This is a compact format using protocol buffers that is used for raster tile rendering in TileMill2 and vector rendering in MapboxGL.

  • TopoJSON: use the .topojson extension. TopoJSON is an optimized form of GeoJSON that saves space by encoding topology and reducing replication of shared geometry.

  • GeoJSON: use the .json extension. GeoJSON is easy to get started with, human-readable, and compatible with many tools.

  • OpenScienceMap-format binary tiles: use the .vtm extension. This is a compact format using protocol buffers that is used in the OpenScienceMap vector rendering library for Android. This legacy format is no longer available in Mapzen's vector tile service.

    We recommend TopoJSON format for desktop web development, and MVT format for native mobile development. The Mapzen vector tile service gzips tiles automatically, so the TopoJSON file format is comparable in file size to MVT over the wire, and it's much friendlier to debug.

Drawing a map

How to draw the tile in a browser is up to the vector-friendly visualization tool, such as SVG, Canvas, or WebGL. The Tangram rendering engine, which uses WebGL, is one way that you can draw the vector tile service in 2D and 3D maps.

How are vector tiles produced?

Vector tiles are served by clipping geometries to the tile bounding box, and then simplified to match the zoom level to avoid unnecessary complexity at lower zoom levels. These geometries and features are also further processed to facilitate styling.

When changes are made to OpenStreetMap or another map data sources, rather than waiting for an image tile to be redrawn, only the geometry coordinates and feature attributes for that particular building or road need to be updated in the vector tile.

Depending on the URL syntax, Mapzen vector tiles can return all of the map data, or just individual layers, or combinations of layers, including water, earth, landuse, roads, buildings and points of interest.

Build from source

If you are interested in setting up your own version of this service, follow these installation instructions, or you can also try this Vagrant VM, which will additionally set up other tile components as well.

Tests

There is a suite of tests which can be run against a tile server to verify query results in well known tiles.

Credits

This is based on the work of Michal Migurski, and extends his OSM.US-hosted vector tile service with additional data and format support.