-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
23 lines (17 loc) · 928 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.PHONY: all
all: db/import/mellowroute.fixture db/import/chicago.table
db/import/%.fixture: app/mbm/fixtures/%.json
(cd app && python manage.py loaddata $*) && touch $@
db/import/chicago.table: db/raw/chicago-filtered.osm
osm2pgrouting -f $< -c /usr/local/share/osm2pgrouting/mapconfig_for_bicycles.xml --prefix chicago_ --addnodes --tags --clean \
-d mbm -U postgres -h postgres -W postgres && \
PGPASSWORD=postgres psql -U postgres -h postgres -d mbm -c " \
UPDATE chicago_ways SET one_way = 2, oneway = 'NO', reverse_cost = cost \
FROM osm_ways \
WHERE osm_ways.osm_id = chicago_ways.osm_id \
AND osm_ways.tags @> 'oneway:bicycle => no'" && \
touch $@
db/raw/chicago-filtered.osm: db/raw/chicago.osm
osmconvert $< --drop-author --drop-version --out-osm -o="$@"
db/raw/chicago.osm:
wget --no-use-server-timestamps -O $@ https://overpass-api.de/api/map?bbox=-87.8558,41.6229,-87.5085,42.0488