Host vector tiles on Amazon S3
Vector tiles can be hosted locally or in the cloud for visualization in a web application or a desktop application like ArcGIS Pro. Visualizing vector tiles in ArcGIS Pro is a convenient option if you have ArcGIS Pro installed and don't want or need to create a web application to view your vector tiles with. This tutorial shows how to write vector tiles to a bucket in AWS S3 and then visualize them in ArcGIS Pro.
Prerequisites
To complete the following steps, you will need:
- A running Spark session configured with ArcGIS GeoAnalytics Engine.
- A notebook connected to your Spark session (e.g. Jupyter, JupyterLab, Databricks, EMR, etc.).
- An internet connection.
- An active AWS subscription.
- An S3 bucket that you can change permissions for.
Steps
Write your vector tiles to an S3 bucket
You must authenticate with S3 to read or
write from a non-public bucket using the AWS_
and AWS_
environment variables or
another supported authentication method.
Once authentication is configured you can read and write to S3 using paths in the format S3://bucket
.
Write a DataFrame
df
to an S3 bucket as vector tiles. See Vector tiles for a detailed explanation of each option.PythonUse dark colors for code blocks Copy
Visualize in ArcGIS Pro
Update the
vector-tile.json
file created with the vector tiles in S3. Thevector-tile.json
file is created with atiles
property which is empty. It looks like the following:"tiles" : ["{z}/{y}/{x}.pbf" ]
You need to download the file and upload a new
vector-tile.json
with an updatedtiles
property. For example, if the vector tiles result is contained in a folder with name “result” and you are uploading to a bucket with name “vectortiles”, the path in the updated file will look similar to:"tiles" : ["https:
//vectortiles.s3.us-west-2.amazonaws.com/result/{z}/{y}/{x}.pbf" ] Update the S3 bucket’s permissions.
In the S3 console, click on the bucket you wrote vector-tiles to and go to the Permissions tab.
You should now be able to view the vector tile result in ArcGIS Pro using the instructions provided in the
Vector tiles core topic. You will need to reference the path to the
vector-tile.json
. In the above example, this would be https:
.