OpenStreetMap C++ tools available as an AWS Lambda Layer!
Run Open Source Routing Machine, Osmium, and Tilemaker in AWS Lambda with precompiled C++ binaries ready to run on Amazon Linux 2023 (used by most Lambda runtimes).
- Open the Releases page and find the latest release.
- Copy the corresponding
Layer ARN
for your AWS Region. - In
AWS Console > Lambda > (function) > Code > Layers
, paste thisLayer ARN
. - Save your function :)
You can confirm your app is ready with an example handler like:
Ensure @project-osrm/osrm
is marked as external
in your bundling tools.
import OSRM from "@project-osrm/osrm";
import ChildProcess from "node:child_process";
export const handler = async (event) => {
console.log(OSRM.version);
ChildProcess.execSync("osmium --version", { stdio: "inherit" });
ChildProcess.execSync("osrm-customize --version", { stdio: "inherit" });
ChildProcess.execSync("tilemaker --help", { stdio: "inherit" });
const response = {
statusCode: 200,
body: JSON.stringify('Hello from Lambda!'),
};
return response;
};
- Split OSRM / Osmium / Tilemaker into individual, combinable layers
- Add other runtime support (mainly CLI-only option)
This project is a part of my larger work on Skyway.run, an indoor navigation app. If you find
aws-lambda-layer-osmtools
useful on your project, let me know and I can list you here.
Contributors or sponsors very welcome :)