Skip to content

imaginerio/vector-tile-generator

Repository files navigation

vector-tile-generator

Pulls features from an ArcGIS Online FeatureServer, merges + cleans them with mapshaper, and emits an XYZ pyramid of Mapbox vector tiles via tippecanoe, then syncs the directory to S3.

Prerequisites

  • Node 20.6+ (see .nvmrc)
  • tippecanoe on PATH (or use Docker)
  • AWS CLI v2 on PATH with credentials configured (or use Docker)

Environment

Set these in .env (read by Node's built-in --env-file):

Var Required Notes
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_DEFAULT_REGION yes AWS CLI credentials
AWS_BUCKET yes Plain S3 URI prefix, e.g. s3://my-bucket/base/
MIN_ZOOM no Tippecanoe -Z, default 9
MAX_ZOOM no Tippecanoe -z, default 17

The ArcGIS API key and FeatureServer URL are hardcoded in index.js.

Usage

nvm use            # switches to Node 20
npm install
npm start          # full pipeline: fetch → merge → tile → upload
npm run upload     # rebuild tiles from existing geojson/final/ and upload
npm run lint
npm run format

Per-page GeoJSON is cached under geojson/. Re-running npm start skips already-fetched pages.

Docker

docker build -t vector-tile-generator .
docker run --rm --env-file .env -v "$HOME/.aws:/home/node/.aws:ro" vector-tile-generator

The image is multi-stage: tippecanoe is compiled in a builder, the runtime is node:20-bookworm-slim with awscli and the tippecanoe binary copied in.

About

Generate vector tiles from ArcGIS REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors