Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating & fixing OSM tutorial #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions docs/kartograph.py/osm.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ After installing [PostgreSQL](http://www.postgresql.org/) and the [PostGIS exten
> createdb osm


Activate PostGIS on that database. You need to know where you installed PostGIS to find the postgis.sql and spatial_ref_sys.sql. For instance, if you installed PostGIS on Mac OS using homebrew, you find them under ``/usr/local/Cellar/postgis/1.5.3/share/postgis/``.
Activate PostGIS on that database.


> psql -d osm -f path/to/your/postgis.sql
> psql -d osm -f path/to/your/spatial_ref_sys.sql
> psql -d osm -c "CREATE EXTENSION postgis;"
> psql -d osm -c "CREATE EXTENSION postgis_topology;"


## Import OpenStreetMap data

Download a fresh OpenStreetMap dump. You can use either the XML version (.osm) or the binary version (.osm.pbf).

> wget http://download.geofabrik.de/osm/europe/germany/berlin.osm.pbf
> wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf


Install [osm2pgsql](http://wiki.openstreetmap.org/wiki/Osm2pgsql) and import the OSM dump into the database.
Expand All @@ -45,10 +44,12 @@ This can take quite a while (and consume lots of RAM), depending on the actual s
And that's it. Now you can create a map using the [latest bleeding edge version of Kartograph](https://github.com/kartograph/kartograph.py/tree/kartograph-2) and the following minimal map configuration:

{
"roads": {
"src": "postgis:dbname=osm",
"table": "planet_osm_roads"
}
"layers": {
"roads": {
"src": "postgis:dbname=osm",
"table": "planet_osm_roads"
}
}
}

Store this as ``map.json`` and run ``kartograph map.json -o map.svg`` to get a map like this:
Expand Down