Skip to content

Commit 0315fe8

Browse files
committed
Added some notes on extracting all osm roads
1 parent 02712f1 commit 0315fe8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

extract-all-osm-roads.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Loading OSM Planet into Postgres and then extracting InaSAFE style roads
2+
3+
wget -c ftp://ftp.spline.de/pub/openstreetmap/pbf/planet-latest.osm.pbf
4+
5+
6+
7+
createdb -T template_postgis osm
8+
9+
10+
echo "# Latest osm tools" >> /etc/apt/sources/list
11+
echo "deb http://ppa.launchpad.net/kakrueger/openstreetmap/ubuntu precise main" >> /etc/apt/sources/list
12+
13+
apt-get update
14+
15+
apt-get install osm2pgsql
16+
17+
osm2pgsql -s -S /usr/share/osm2pgsql/default.style -c -l -d osm /tmp/planet-latest.osm.pbf
18+
19+
psql -f <path-to-osm-reporter>/resources/roads.sql osm
20+
21+
22+
pgsql2shp -f osm-roads.shp osm "SELECT st_transform(way, 4326) AS the_geom, name, highway as osm_type, type FROM planet_osm_line WHERE highway != 'no';"
23+
24+
tar cfj osm-roads.tar.bz2 osm-roads.*
25+
26+

0 commit comments

Comments
 (0)