Galton
Lightweight Node.js isochrone server. Build isochrones using OSRM, Turf and concaveman.
Francis Galton is the author of the first known isochrone map.
Installation
Galton requires Node v8.
npm install -g galton
...or build from source
git clone https://github.com/urbica/galton.gitcd galtonnpm install
Usage
Usage: galton [filename] [options] where [filename] is path to OSRM data and [options] is any of: --radius - distance to draw the buffer --cellSize - the distance across each cell --concavity - concaveman relative measure of concavity --deintersect - whether or not to deintersect the final isochrones --intervals - isochrones intervals in minutes --lengthThreshold - concaveman length threshold --pid - save PID to file --port - port to run on --sharedMemory - use shared memory --socket - use Unix socket instead of port --units - either `kilometers` or `miles` --version - returns running version then exits
galton berlin-latest.osrm
Open examples/index.html?access_token=<token>
Example
cd galtonwget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf./node_modules/osrm/lib/binding/osrm-extract -p ./node_modules/osrm/profiles/car.lua berlin-latest.osm.pbf./node_modules/osrm/lib/binding/osrm-contract berlin-latest.osrmnpm start berlin-latest.osrm
Build isochrones from point
curl http://localhost:4000 --get --data 'lng=13.38792&lat=52.51704'
Build isochrones for 10, 20 and 30 minute intervals
curl http://localhost:4000 --get --data 'lng=13.38792&lat=52.51704&intervals=10&intervals=20&&intervals=30'
See the example, API and test/index.js
for more info.
Using with Docker
docker run -p 4000:4000 urbica/galton <OSRM>
Where OSRM
is a path to OSRM graph.
Examples:
This will download geofabrik extract, extract and build OSRM graph using official OSRM Docker image, and run galton on that graph.
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbfdocker run -t -v $(pwd):/data osrm/osrm-backend:v5.17.2 osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbfdocker run -t -v $(pwd):/data osrm/osrm-backend:v5.17.2 osrm-contract /data/berlin-latest.osrmdocker run -t -i -p 4000:4000 -v $(pwd):/data urbica/galton:v5.17.2 galton /data/berlin-latest.osrm
curl http://localhost:4000 --get --data 'lng=13.38792&lat=52.51704'
Running tests
make test