• Stars
    star
    268
  • Rank 153,144 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lightweight Node.js isochrone map server

Galton

npm version npm downloads Build Status Greenkeeper badge

Lightweight Node.js isochrone server. Build isochrones using OSRM, Turf and concaveman.

Francis Galton is the author of the first known isochrone map.

Screenshot

Installation

Galton requires Node v8.

npm install -g galton

...or build from source

git clone https://github.com/urbica/galton.git
cd galton
npm install

Usage

Usage: galton [filename] [options]

where [filename] is path to OSRM data and [options] is any of:
  --radius - distance to draw the buffer (default: 6)
  --cellSize - the distance across each cell (default: 0.2)
  --concavity - concaveman relative measure of concavity (default: 2)
  --deintersect - whether or not to deintersect the final isochrones (default: true)
  --intervals - isochrones intervals in minutes (default: 10 20 30)
  --lengthThreshold - concaveman length threshold (default: 0)
  --pid - save PID to file
  --port - port to run on (default: 4000)
  --sharedMemory - use shared memory (default: false)
  --socket - use Unix socket instead of port
  --units - either `kilometers` or `miles` (default: kilometers)
  --version - returns running version then exits
galton berlin-latest.osrm

Open examples/index.html?access_token=<token>

Example

cd galton
wget 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.osrm
npm 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.

Examples

Using existing OSRM graph

This command will run isochrone server using moscow.osrm

galton moscow.osrm

Using existing OSM extract

This command will build OSRM graph with car profile using moscow.osm extract and start isochrone server.

galton moscow.osm car

Using geocode to extract from OSM

  1. It will look for moscow.osrm in the current directory and start isochrone server if found.
  2. If it is not found, it will look for moscow.osm in the current directory, build OSRM graph with car profile, based on this extract, and start isochrone server if found.
  3. If there is no moscow.osm, galton will geocode moscow and extract it from Overpass API, then it will build OSRM from that extract with car profile and start isochrone server.
galton moscow car

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.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend:v5.18.0 osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
docker run -t -v $(pwd):/data osrm/osrm-backend:v5.18.0 osrm-contract /data/berlin-latest.osrm
docker run -t -i -p 4000:4000 -v $(pwd):/data urbica/galton:v5.18.0 galton /data/berlin-latest.osrm
curl http://localhost:4000 --get --data 'lng=13.38792&lat=52.51704'

Running tests

make test

More Repositories

1

react-map-gl

React Component Library for Mapbox GL JS
JavaScript
416
star
2

tessella

Lightweight Node.js Mapbox Vector Tiles server
JavaScript
83
star
3

react-map-gl-draw

React Component for Mapbox GL Draw
JavaScript
50
star
4

gis-notebook

Jupyter Notebook Python GIS Stack
44
star
5

pg-migrate

PostgreSQL migration tool
JavaScript
42
star
6

bikes

Bike share data visualisation
JavaScript
37
star
7

react-map-gl-cluster

Urbica React Cluster Component for Mapbox GL JS
JavaScript
26
star
8

noisemap

The project for MUF-Labs hackathon
HTML
19
star
9

areal

An iOS augmented reality app with a map of Saint Petersburg and it’s 3D landmark models
C#
17
star
10

ui-kit

Urbica UI Kit πŸ‹
JavaScript
16
star
11

osm-extractor

Extracts data from OpenStreetMap
JavaScript
15
star
12

walkstreets

Walking Streets project
HTML
15
star
13

docker-otp

OpenTripPlanner Docker image
Dockerfile
13
star
14

citibike-nyc

Mapbox GL JS feature state usage example
HTML
11
star
15

velodata

Bike share statistics 2015 in Moscow
10
star
16

node-martin

Mapbox Vector Tiles Server 🐦
JavaScript
7
star
17

datamos-geojson

Small tool to download geoJSON files from data.mos.ru
JavaScript
6
star
18

charts

Urbica React D3 Components
JavaScript
5
star
19

osrm-bindings

The Open Source Routing Machine bindings wrapper for NodeJS
JavaScript
4
star
20

urbanlayers

Small geospatial research
JavaScript
3
star
21

citibike

Citibike NYC Rebalanced
JavaScript
3
star
22

docker-postgis

PostGIS Docker image
Shell
3
star
23

martin-landing

JavaScript
2
star
24

hurricane-map

JavaScript
2
star
25

taxi-trips

HTML
2
star
26

map-tab-gl

JavaScript
2
star
27

workshop

HTML
2
star
28

gulag-exposition

Gulag map exposition UI
JavaScript
2
star
29

map-compare-tool

Small tool to compare different maps
JavaScript
1
star
30

eslint-config-urbica

Urbica ESLint config
JavaScript
1
star
31

homebrew-tap

macOS Homebrew formulas to install Urbica open source software 🍺
Ruby
1
star
32

gulag-front

Gulag map user interface
JavaScript
1
star
33

gulag-ui-kit

A list of common components for Gulag web and exposure versions
JavaScript
1
star
34

humans

Humans prototype
JavaScript
1
star
35

gulag-admin

Gulag map administrative UI
JavaScript
1
star
36

albatros

Rust
1
star
37

stuurman

Wicked router
Python
1
star
38

walksreets-ios

Walking Streets iOS mobile app
Swift
1
star
39

gulag-api

Gulag map API
JavaScript
1
star