Giter Club home page Giter Club logo

lambda-geotrellis-tile-server's Introduction

Lambda Geotrellis Tile Server

This repository creates a geotrellis tile server on AWS's API Gateway service, backed by AWS Lambda. The resulting url pattern is:

https://<aws url>/tile/{b}/{p}/{l}/{v}/{z}/{x}/{y}/

Getting data

b, p, and l specify an s3 path to a RasterRDD.

  • b is the bucket
  • p is the url-encoded prefix
  • l is the url-encoded name of the layer

{z}/{x}/{y} is just normal TMS stuff.

Visualizing your layer

The v parameter specifies what type of visualization you'd like. All of the ColorRamps from geotrellis.raster.render.ColorRamps are available with shortened case-insensitive string names. Those names and the corresponding ColorRamps are:

  • viridis: Viridis
  • magma: Magma
  • inferno: Inferno
  • plasma: Plasma
  • blor: BlueToOrange
  • ylor: LightYellowToOrange
  • blrd: BlueToRed
  • gror: GreenToRedOrange
  • sunsetdark: LightToDarkSunset
  • greens: LightToDarkGreen
  • ylrd: HeatmapYellowToRed
  • blylrd: HeatmapBlueToYellowToRedSpectrum
  • rdylwt: HeatmapDarkRedToYellowWhite
  • prwt: HeatmapLightPurpleToDarkPurpleToWhite
  • landuse: ClassificationBoldLandUse
  • terrain: ClassificationMutedTerrain

To return an RGB png, pass rgb as the visualization type. No promises about what will happen if you ask for an rgb visualization of a single band tiff.

If you pass in any other string name, you'll get Viridis. You probably wanted Viridis anyway, since it's so pretty.

There's currently no way to specify class breaks, so landuse and terrain currently look pretty dumb.

Deployment

tl;dr: ./scripts/publish

Longer version:

You'll need the following AWS permissions:

  • cloudformation:*
  • lambda:*
  • apigateway:*

Once that's set up for your user:

  • Configure your AWS profile
  • npm install -g serverless
  • ./scripts/publish
  • Configure your API gateway endpoint from the AWS console:
    • Set binary media types to image/png in the options for your API
    • Navigate to the GET endpoint and set "Content handling" in its integration response to "Convert to binary (if needed)" for your resource
  • Deploy the API using the Actions dropdown

lambda-geotrellis-tile-server's People

Contributors

jisantuc avatar lossyrob avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.