
- Blog Post – introduces and showcases this capability.
- Jupyter Notebook (this file) – step-by-step code for generating the PMTiles file.
- Web Visualization Repo – tile server and client code using the Esri JavaScript SDK.
- Download and prepare the TIGER railroad shapefile and store it in Wherobots Managed Storage.
- Filter nationwide data to a specific region, Texas, using Spatial SQL with Sedona.
- Generate a PMTiles file using the Wherobots
vtileslibrary. - Visualize the resulting map tiles directly within the notebook.
Cost to generate PMTiles for Texas
- Time taken: 1m 18s
- Cost: $0.16
- Runtime size: Tiny
Download the railroad dataset from TIGER
This piece of code is a helper function that downloads the zipped folder, extracts it, and uploads it to your Managed Storage (S3 bucket). If the TIGER dataset’s FTP server is down, we have mirrored the data in our public S3 bucket:s3://wherobots-examples/data/pmtiles-blog/tl_2024_us_rails/
Getting WherobotsDB started
This gives you access to WherobotsDB and PMTiles generatorRead in the files that we downloaded
Filter by Texas boundary
Feel free to alter this to some other US state or remove it entirely to get the same experience of the blog. The code to generate PMTiles on the entire dataset:wkls library.
FYI about the data
MTFCC stands for MAF/TIGER Feature Class Code and is a code that is assigned by the U.S. Census Bureau to classify and describe geographic objects or features, such as roads, rivers, and railroad tracks. The MTFCC codeR1011 means a Railroad Feature (Main, Spur, or Yard).
LINEARID is a Linear Feature Identifier, a unique ID number used in U.S. Census Bureau TIGER (Topologically Integrated Geographic Encoding and Referencing) data to associate a street or feature name with its location, such as an edge or address range in the spatial data.

