Vector tiles: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:


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


=== The obvious one ===
About [https://hackage.haskell.org/package/vectortiles Mapbox 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 Pro - generate tiles
Line 9: Line 13:


In this [https://blogs.esri.com/esri/arcgis/2015/07/20/vector-tiles-preview/ blog post] ESRI says they
In this [https://blogs.esri.com/esri/arcgis/2015/07/20/vector-tiles-preview/ blog post] ESRI says they
based their API on mapbox-gl.js
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
 
=== Publish Vector Tiles to Portal ===
 
https://enterprise.arcgis.com/en/portal/latest/use/publish-vector-tiles.htm
 
# Install ArcGIS Pro
# Create a map
## Add your standard data, taxlots in my case.
## Reproject your data into Web Mercator
# [http://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-vector-tile-package.htm Create Vector Tile Package]
## Create an vector index
## Create a vector tile package
## Use "Add Data" in AGP to preview at the results.
## Publish
 
I create the vector index and vector tile package using a Python script, see c:/Users/bwilson/source/repos/WebMaps/VectorTiles-Taxlots-Project/
 
==== About the tile package ====
 
https://pro.arcgis.com/en/pro-app/help/sharing/overview/vector-tile-package.htm
 
The generated file is a ZIP archive with a vtpk extension. It contains


=== The open source tools ===
* tilemap/root.json Styles are here.
* 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; looks like there are sprites. They use sprites for things like textures.


* Generate tiles
Learn how to tweak styles, fonts, picture markers:
* Serve tiles
https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/working-with-fonts-and-sprites-being-creative-with-esri-vector-tiles/
* Browser options:
** mapbox-gl.js, see https://github.com/mapbox/mapbox-gl-js
** [https://openlayers.org/en/latest/examples/osm-vector-tiles.html Openlayers 5] appears to not work.
** [https://openlayers.org/en/latest/examples/mapbox-vector-tiles.html OpenLayers 5] + Mapbox = works.
** [http://leafletjs.com Leaflet]


==== Vector base maps ====
This is what the "share as" dialog should look like, note especially '''"Copy all data"''' checkbox.
[[Image:ShareAsWebLayer.png]]


* https://openmaptiles.org/
== 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 sources:
* I put a taxlot layer up on ArcGIS Online
* There are ESRI basemaps in vector format
* I will also try Mapbox since I already set up an account there.
 
That's all I need to set up a test! I have added it to [[Map46]] in Github in vectortiles/ folder.
 
== Vector base maps ==
 
These are generally free services at the levels I will be using them.
 
* https://www.maptiler.com/cloud  (Klokan also openmaptiles.com and openmaptiles.org) [https://www.maptiler.com/how-to/maps-with-javascript/ How to]
* http://mapbox.com
* http://mapbox.com
* https://www.mapcat.com/
* https://www.mapcat.com/
* https://thunderforest.com/
* https://thunderforest.com/
=== OpenMapTiles ===
I can download some tiles for free then serve them on Bellman by also grabbing their Docker.
I will be trying this out tonight when I am on map46 time.
It said "free downloads" but when I asked for a custom extent to limit download size it said $10.
I asked for data in this extent -124.18945,45.62172,-123.11279,46.42271
Zoom 10 to 14 (14 is as good as it gets)
I changed my request to "Oregon" and "evaluation and education" and we're good.


[[Category: GIS]]
[[Category: GIS]]

Latest revision as of 00:04, 17 October 2018

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

About Mapbox 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

Publish Vector Tiles to Portal

https://enterprise.arcgis.com/en/portal/latest/use/publish-vector-tiles.htm

  1. Install ArcGIS Pro
  2. Create a map
    1. Add your standard data, taxlots in my case.
    2. Reproject your data into Web Mercator
  3. Create Vector Tile Package
    1. Create an vector index
    2. Create a vector tile package
    3. Use "Add Data" in AGP to preview at the results.
    4. Publish

I create the vector index and vector tile package using a Python script, see c:/Users/bwilson/source/repos/WebMaps/VectorTiles-Taxlots-Project/

About the tile package

https://pro.arcgis.com/en/pro-app/help/sharing/overview/vector-tile-package.htm

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

  • tilemap/root.json Styles are here.
  • 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; looks like there are sprites. They use sprites for things like textures.

Learn how to tweak styles, fonts, picture markers: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/working-with-fonts-and-sprites-being-creative-with-esri-vector-tiles/

This is what the "share as" dialog should look like, note especially "Copy all data" checkbox.

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 sources:

  • I put a taxlot layer up on ArcGIS Online
  • There are ESRI basemaps in vector format
  • I will also try Mapbox since I already set up an account there.

That's all I need to set up a test! I have added it to Map46 in Github in vectortiles/ folder.

Vector base maps

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

OpenMapTiles

I can download some tiles for free then serve them on Bellman by also grabbing their Docker. I will be trying this out tonight when I am on map46 time.

It said "free downloads" but when I asked for a custom extent to limit download size it said $10. I asked for data in this extent -124.18945,45.62172,-123.11279,46.42271 Zoom 10 to 14 (14 is as good as it gets)

I changed my request to "Oregon" and "evaluation and education" and we're good.