A toy tile server built on the Esri Compact Cache V2 and Tile Package formats.
It's a toy.
Assuming you have a working Rust environment:
git clone ~repo_url
cd slate
mkdir data
cd data
curl -O https://github.com/Esri/tile-package-spec/tree/5276322c7bdf1208568b67de241a5535f213d319/Sample%20TPKX%20Files/Usa.tpkx
cd ..
cargo run
This clones the repo, grabs a sample tile package, and spins the server up. Now open up http://localhost:3000/rest/services/Usa/MapServer in your browser and you should see a bunch of json describing the tile package!
That's it! There's plenty of bad code paths here that assume some local setup that I have, but otherwise it's minimally functional.
In theory, the following would be needed to make this more than a toy:
- Repository API that allows this to source tpkx from places other than a specific local dir + config injection (this could enable serving from an S3 bucket or configured local dir, for example)
- Remove all the weird code paths
- Export tiles functionality that lets users roundtrip from service to tile package
- Properly handle concurrent read/write of data on the file system
- More robust handling of concurrent requests using tokio's runtime
- Better project setup (linter, coverage, tests in ci, etc)
In other words, all the prod-grade stuff that makes having a tile server worthwhile! I wrote this as an exercise.