Vector tiles

From Wildsong
Jump to navigationJump to search

I am looking at what it will take to set up a stack to use vector tiles.

The obvious approach

After it was already picking up speed, ESRI jumped in and added tile support. I have no idea (yet) if there is any compatibility.

  • ESRI ArcGis Pro - generate tiles
  • ESRI ArcGis Enterprise - serve tiles
  • ESRI ArcGIS API for Javascript - browser support

In this blog post ESRI says they based their API on mapbox-gl.js. Amusingly ESRI doesn't seem to index this page, if you search for mapbox, only some unrelated article comes up.

The ESRI basemaps seem to be all raster based only at this time, though I have this link: http://basemapsbeta.arcgis.com/preview/app/index.html

Tile generation

  1. Install ArcGIS Pro
  2. Create a map
  3. Create Vector Tile Package
    1. Create a map and add your standard data
    2. Reproject data into Web Mercator
    3. Create an vector index
    4. Create a vector tile package

About the tile package

The generated file is a ZIP archive with a vtpk extension. It contains

  • tilemap/root.json
  • An esriinfo folder containing item.pkinfo, iteminfo.xml, and thumbnail/thumbnail.png
  • about a hundred PBF files = "protocol buffer" that look like font data ("Tahoma Regular")?!?
  • tile/??/*.bundle files, about 2 dozen.
  • a medley of other supporting files

root.json contains {"index":[[0,0,[0,[0,0,[0,0,[0,[0,0,0,[0,[0,0,0,[0,0,0,[[1,1,1,[1,1,1,1]],1,[0,[1,[1,1,1,1],1,[1,1,1,1]],0,[0,1,0,1]],[[1,[1,[1,1,1,1],1,1],[1,1,1,1],[1,1,1,1]],[[[1,1,1,1],1,1,1],[1,1,1,1],1,1],[1,[1,1,1,1],1,1],[[1,1,1,1],1,1,1]]]]],0,[0,[0,[[0,[0,1,0,1],0,[0,[0,1,0,[1,[1,1,1,1],1,1]],1,[1,1,1,1]]],[[[1,1,1,1],1,[[1,1,1,1],1,[1,1,1,1],1],1],1,[[[1,1,1,1],1,[1,1,1,1],1],1,1,1],1],[0,[1,1,1,[1,1,1,1]],0,[1,[1,1,1,1],1,1]],[1,1,1,1]],0,[[0,1,0,0],1,0,0]],0,0]]],0,0],[[0,0,[[0,0,[0,0,[[1,1,1,[1,1,1,[1,[1,1,1,1],1,1]]],[1,1,[[1,[1,1,1,[1,1,1,1]],[[1,1,1,1],1,[1,1,1,1],1],[1,1,1,1]],[[1,1,1,1],1,1,1],[1,1,1,1],[1,1,1,1]],[[[1,1,1,1],1,1,1],1,1,1]],[[1,1,1,1],[[1,1,1,1],[1,1,1,1],1,1],[1,1,1,1],1],[[1,1,1,1],1,1,[1,1,1,1]]],[0,0,[1,0,1,0],0]],0],0,[[[[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,[1,1,1,1],1]],[1,0,1,0],[1,1,0,0],1],0,0,0],0],0],0,0,0]],0],0,0],0],0,0,0]}

Boring!

The open source option

A lot is happening in this space. Instead of putting many links here, just look at this firehose of open source vector tile resources: https://github.com/mapbox/awesome-vector-tiles

My choices

I have to start somewhere.

Browser client: I want to try mapbox-gl but since I already have familiarity with Openlayers, I will try it first.

Tile source: I will try Mapbox since I already set up an account there.

That's all I need to set up a test! I will add it to map46 in Github.

Vector base maps

These are generally free services at the levels I will be using them.