-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS 2-6: Generate, Store Static Tiles for Lower Zoom Levels #9
Comments
This notebook guides how to generate static tiles locally: https://github.com/WikiWatershed/mmw-tiler/blob/main/mosaic.ipynb |
Here's the RGBA colormap for this dataset: { 0: {'color': '#00000000', 'label': 'No Data'},
1: {'color': '#419BDFFF', 'label': 'Water'},
2: {'color': '#397D49FF', 'label': 'Trees'},
4: {'color': '#7A87C6FF', 'label': 'Flooded vegetation'},
5: {'color': '#E49635FF', 'label': 'Crops'},
7: {'color': '#C4281BFF', 'label': 'Built area'},
8: {'color': '#A59B8FFF', 'label': 'Bare ground'},
9: {'color': '#A8EBFFFF', 'label': 'Snow/ice'},
10: {'color': '#616161FF', 'label': 'Clouds'},
11: {'color': '#E3E2C3FF', 'label': 'Rangeland'} } |
I updated the comment above to indicate that we should put the tiles in tile-cache.staging.modelmywatershed.org in US-EAST-1 |
Since I'll be away for a week (returning 7/5), a writeup of what I've been trying to do on this and where it has taken me so far: Then I switched gears to trying to get titiler-mosaicjson running locally, toward the goal of figuring out where the branch point for static vs. dynamic should go. To that end, I first spun up a local MMW instance. That went fine except I had to change I added a layer config to
That worked, i.e. I could get tiles by activating that layer. To try to replace that staging endpoint with a local one I could modify and debug with, I checked out titiler-mosaicjson and started it up locally. Running titiler-mosaicjsonThe README describes global installation of the dependencies. There is a Docker build in the Filmdrop Terraform config, but just running it on host in a venv seemed like the simplest way to go.
The addition of DynamoDB localRunning a local DynamoDB for dev/debugging is simple:
So is making a table:
Then I ran the titiler-mosaicjson server with
but I didn't have any luck getting the server to connect to the DynamoDB container. It kept saying "Invalid DynamoDB path". No doubt it can be done, but I realized titiler-mosaicjson could also run with a file backend, so I fell back to using that (by just running it without those environment variables. It defaults to file backend). mosaic creationAfter starting the titiler service:
I sent a request, adapted from the README, to it to make a mosaic:
Swapping the resulting tile URL template in for the Next stepsThe goal of the above was to get a view into how the TiTiler service handles tile requests and figure out where to attach a "read generated tiles from S3" step. Since it encodes the request parameters, pulling cached files rather than generating new ones will either have to happen inside the service, after it has made that translation, or we'll need to borrow or reproduce the encoding logic to identify the right S3 path for a given tile. I didn't quite get to where I was trying to go yet, but hopefully I'm on the right track and not far off. The Jupyter notebook makes sense as a strategy for generating the tiles. I think the errors might be caused by |
TiTiler is optimized for tiling images at higher zoom levels, where only a small portion of a tile would be read, and in most cases a single tile. At lower zoom levels, a much larger number of tiles have to be read, resulting in long wait times which will exceed the built-in timeouts (30s for API Gateway, and 15m for Lambda).
To get around this, we should create static tiles for the lower zoom levels and upload them to S3. Then, we can have a proxy which can serve the lower zoom levels from the static tile bucket, and the higher levels via normal TiTiler endpoints.
For this card:
Create a bucket in the MMW-STG AWS account in the US-WEST-2 region and upload the files thereUpload them totile-cache.staging.modelmywatershed.org
bucket in US-EAST-1The text was updated successfully, but these errors were encountered: