Comments (1)
Hi @jliebrand - thanks for the question! Knowing where your tiles are, and if they are updated, is outside the scope of this library (and the vector tile specification, which this adheres to). That said, you're on the right track with moving everything to a new s3 prefix (not saying this is the only way). I'd suggest having some sort of intermediate service in the API request that knows where your tilest lives on s3. The HTTP request remains the same but your API internals GET from an updated s3 prefix.
So for example (this has a lot of assumptions):
Let's say you have a tileset called neat-tileset
. The first time you copy tiles to s3 you run the following command you could add a customized prefix to the s3 location, like v1
:
mapbox-tile-copy neat-data.geojson s3://bucket/neat-tileset/v1/{z}/{x}/{y}
So when you request a tile through your API with the following URL
https://api.example.com/neat-tileset/0/0/0.mvt
Your API would see that request and have some sort of knowledge of where on S3 the neat-tileset
tiles live. Let's say it's a TILESET_PREFIX
variable set to v1
. You're able to get the tile from that s3 bucket/prefix and return it.
Then you make a change to the source data and update neat-tileset
. You may go to v2
and use the following command:
mapbox-tile-copy neat-data.geojson s3://bucket/neat-tileset/v2/{z}/{x}/{y}
At this point, the last big change you'll have to do is update your TILESET_PREFIX
to be set to v2
so you're grabbing tiles from the new location.
Drawbacks?
Certainly. Depending on the API that is built and service you are using you'll want to figure out how to set expire tags and content headers so any sort of cache will notice this being a new request and not an old v1 request. Storage costs can become a factor if you do this at scale, and determining where TILESET_PREFIX
lives and how it is updated can be challenging. But I'll leave those decisions to you :)
Going to close this since as I mentioned before, the feature is out of scope of this library.
from mapbox-tile-copy.
Related Issues (20)
- support server side encryption (sse) instead of hardcoding aes256 HOT 3
- Depending on cutting-room-floor module HOT 8
- Add Error Handler for "x is out of range" HOT 1
- Add tracker for invalid/valid vector tiles HOT 1
- npm install can't get precompiled binaries HOT 4
- Validate parts
- Add error handling for supporting deflate coded vector tiles HOT 1
- serving Tiles on S3?
- npm errors HOT 1
- upgrade mbtiles to 0.10.0
- Implement S3 Cleanup Routine
- "Tile does not exist" error HOT 2
- Fails on buckets containing dots HOT 4
- "Connection timed out after 2000ms" HOT 2
- Update mapnik dependency HOT 2
- generating raster tiles from vector tiles
- undefined symbol: napi_add_finalizer HOT 1
- Reduce your request rate
- Mapnik arm64 binary not accessible on arm64 darwin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapbox-tile-copy.