Package: terracotta
Terracotta is a pure Python tile server that runs as a WSGI app on a
dedicated webserver or as a serverless app on AWS Lambda. It is built on a
modern Python stack, powered by awesome open-source software such asFlask,Zappa,
andRasterio.Read the docs|Explore the API|Satlas, powered by TerracottaWhy Terracotta?It is trivial to get going. Got a folder full ofcloud-optimized GeoTiffsin different
projections you want to have a look at in your browser?terracotta serve -r {name}.tifandterracotta connect localhost:5000get you there.We make minimal assumptions about your data, soyou stay in charge.
Keep using the tools you know and love to create and organize your
data, Terracotta serves it exactly as it is.Serverless deployment is a first-priority use case, so you don’t have
to worry about maintaining or scaling your architecture.Terracotta instances are self-documenting. Everything the frontend
needs to know about your data is accessible from only a handful of
API endpoints.The Terracotta workflow1. Optimize raster files$ls-lh
total1.4G
-rw-r--r--1dimh1049089231MAug2916:45S2A_20160724_135032_27XVB_B02.tif
-rw-r--r--1dimh1049089231MAug2916:45S2A_20160724_135032_27XVB_B03.tif
-rw-r--r--1dimh1049089231MAug2916:46S2A_20160724_135032_27XVB_B04.tif
-rw-r--r--1dimh1049089231MAug2916:56S2A_20170831_171901_25XEL_B02.tif
-rw-r--r--1dimh1049089231MAug2916:57S2A_20170831_171901_25XEL_B03.tif
-rw-r--r--1dimh1049089231MAug2916:57S2A_20170831_171901_25XEL_B04.tif

$terracottaoptimize-rasters*.tif-ooptimized/

Optimizingrasters:100%|██████████████████████████|[05:16<00:00,file=S2A_20170831_...25XEL_B04.tif]2. Create a database from file name pattern$terracottaingestoptimized/S2A_{date}_{}_{tile}_{band}.tif-ogreenland.sqlite
Ingestingrasterfiles:100%|███████████████████████████████████████████|6/6[00:49<00:00,8.54s/it]3. Serve it up$terracottaserve-dgreenland.sqlite*ServingFlaskapp"terracotta.server"(lazyloading)*Environment:productionWARNING:Donotusethedevelopmentserverinaproductionenvironment.UseaproductionWSGIserverinstead.*Debugmode:off*Runningonhttp://localhost:5000/(PressCTRL+Ctoquit)4. Explore the running serverManuallyYou can use any HTTP-capable client, such ascurl.$curllocalhost:5000/datasets?tile=25XEL{"page":0,"limit":100,"datasets":[{"date":"20170831","tile":"25XEL","band":"B02"},{"date":"20170831","tile":"25XEL","band":"B03"},{"date":"20170831","tile":"25XEL","band":"B04"}]}Modern browsers (e.g. Chrome or Firefox) will render the JSON as a tree.InteractivelyTerracotta also includes a web client. You can start the client (assuming the server is running athttp://localhost:5000) using$terracottaconnectlocalhost:5000*ServingFlaskapp"terracotta.client"(lazyloading)*Environment:productionWARNING:Donotusethedevelopmentserverinaproductionenvironment.UseaproductionWSGIserverinstead.*Debugmode:off*Runningonhttp://127.0.0.1:5100/(PressCTRL+Ctoquit)Then open the client page (http://127.0.0.1:5100/in this case) in your browser.DevelopmentWe gladly acceptbug reportsandpull requestsvia GitHub.
For your code to be useful, make sure that it is covered by tests and that
it satisfies our linting practices (viamypyandflake8).To run the tests, just install the necessary dependencies via$pipinstall-e.[test]Then, you can run$pytestfrom the root of the repository.