{"id":18174882,"url":"https://github.com/kylebarron/serverless-slope","last_synced_at":"2025-10-25T18:50:17.764Z","repository":{"id":39124238,"uuid":"250963136","full_name":"kylebarron/serverless-slope","owner":"kylebarron","description":"Serverless, worldwide hillshade and slope angle shading tiles","archived":false,"fork":false,"pushed_at":"2023-01-05T17:54:02.000Z","size":2873,"stargazers_count":12,"open_issues_count":12,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-23T07:28:24.030Z","etag":null,"topics":["raster","serverless","slope-calculation","terrain"],"latest_commit_sha":null,"homepage":"https://kylebarron.dev/serverless-slope","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylebarron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-29T05:47:15.000Z","updated_at":"2024-11-14T14:12:10.000Z","dependencies_parsed_at":"2023-02-04T09:16:02.753Z","dependency_job_id":null,"html_url":"https://github.com/kylebarron/serverless-slope","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fserverless-slope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fserverless-slope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fserverless-slope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fserverless-slope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylebarron","download_url":"https://codeload.github.com/kylebarron/serverless-slope/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232132559,"owners_count":18477166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["raster","serverless","slope-calculation","terrain"],"created_at":"2024-11-02T16:08:02.842Z","updated_at":"2025-10-25T18:50:12.725Z","avatar_url":"https://github.com/kylebarron.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-slope\n\nServerless, worldwide slope angle shading tiles generated from [AWS Terrain\nTiles](https://registry.opendata.aws/terrain-tiles/).\n\n**NOTE**: I think I currently have some z-scaling issues, because the generated\ntiles indicate lesser slopes than [another project](https://nst.guide) (turn on\nslope-angle shading) which uses precomputed tiles from `gdaldem`.\n\n## Motivation\n\nOne of the many great AWS Open Data datasets is [terrain\ntiles](https://registry.opendata.aws/terrain-tiles/). These are a collection of\nworldwide elevation products stored on AWS S3 for anyone to use. This project\nshows how easy, fast, and cheap it is to leverage AWS Open Data for hobby\nprojects.\n\nSlope-angle shading is a great overlay for many types of outdoor planning. The\ndarker the colors, the steeper the slope, the more you need to make sure you're\nprepared.\n\nThis uses [Caltopo's](https://caltopo.com) slope-angle shading color scheme by\ndefault, but it's trivial to supply a different set of RGB values to make a\ndifferent color scheme.\n\n## Deploy\n\nDeployment should be easy and fast. This requires Docker, Python, and Node:\n\n```bash\ngit clone https://github.com/kylebarron/serverless-slope\ncd serverless-slope\nmake package\nnpm i -g serverless\nsls deploy --bucket bucket-where-you-store-data --cache-control \"public,max-age=4000\"\n```\n\n## Pricing\n\nRoughly ~$5.70 per 1M requests. Note this is for requests _that reach Lambda_.\nBy using Cloudflare and an appropriate cache control header, this could be\nsubstantially reduced.\n\nLambda:\n\n- $0.20 per 1M requests\n- Set to 192MB and if each invocation takes .9s, per 1M requests:\n\n    $0.0000166667 GB-second / * 192 / 1024 * .9 * 1M = $2.81\n\nAPI Gateway:\n\n- $1.00 per 1M requests\n\nData Transfer:\n\n20 KB * 1M / 1024 / 1024 * $0.09 = $1.70\n\n### Ways to lower prices:\n\n- Use Cloudflare to cache images with a long cache control header\n\n### Hosted comparison\n\nAt zoom 15, there are 4^15 ~= 1 Billion tiles to cover the globe. At 10KB per\ntile, that would be 10TB of data, or $235/month _just to store on S3_. Obviously\nmuch of the globe is water, so you could be smarter and not store non-land\ntiles, but it's not going to be as cheap for low to mid-range use as serverless\nis.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebarron%2Fserverless-slope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylebarron%2Fserverless-slope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebarron%2Fserverless-slope/lists"}