Sign inSign up

ukhydrographicoffice/lambda-layer-geoutils

By ukhydrographicoffice

Updated almost 6 years ago

Provides various Geospatial Python packages and GDAL built for the Amazon Linux OS

Image
1

2.0K

ukhydrographicoffice/lambda-layer-geoutils repository overview

lambda-layer-geoutils

Tag: 3.*

Details

Python Version: 3.7 GDAL Version: 3.0

This image provides a mechanism for building a .zip to be used as a AWS Lambda Layer containing the following packages:

lambda-proxy~=5.0
numpy
pygeos
pyproj==2.4.1 (only with GDAL 3.0)
rasterio[s3]
requests
rio-cogeo
rio-color
rio-tiler
rio_tiler_mosaic
rio_tiler_mvt
shapely
supermercado

It also contains rasterioutils, a package for getting rasterio sessions based on running in LocalStack or AWS

It is based upon: https://github.com/RemotePixel/cogeo-layer

To extract the .zip

$ docker build --tag ukhydrographicoffice/lambda-layer-geoutils:latest .
$ docker run --name geoutils -w /var/task -itd ukhydrographicoffice/lambda-layer-geoutils:latest bash
$ docker cp geoutils:/tmp/package.zip geoutils.zip
$ docker stop geoutils
$ docker rm geoutils

To deploy to AWS

  • Log in to AWS
  • Navigate to Lambda > Layers > <Your layers name> > Create version
  • Upload the zip, select Python 3.7 for the runtime, and click Create
  • Update any functions using the old version to point to the new version

Tag: 2.*

This image provides a mechanism for building a .zip to be used as a AWS Lambda Layer containing the following packages:

  • gdal 2.4.2
  • fiona
  • numpy
  • pyproj
  • rasterio[s3]
  • requests
  • shapely

The base image is remotepixel/amazonlinux-gdal:2.4.2

To extract the .zip, run the following:

$ docker run -d --name <name-of-choice> ukhydrographicoffice/lambda-layer-geoutils:2.0.0 bash
$ docker cp <name-of-choice>:/build/package.zip /your/path/to/target/package.zip

You can then upload package.zip as a AWS Lamba Layer

Note:

Any AWS Lambdas that use this layer will need the following Environment Variables set:

  • GDAL_DATA = /opt/share/gdal
  • PROJ_LIB = /opt/share/proj

License

MIT License

Copyright (c) 2019 Crown Copyright (UK Hydrographic Office)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Tag summary

Content type

Image

Digest

Size

923 MB

Last updated

almost 6 years ago

docker pull ukhydrographicoffice/lambda-layer-geoutils