Setup Route altitude profiles SRTM

From OpenStreetMap Wiki
Jump to navigation Jump to search

This page will guide you when setting up a Route altitude profiles server. Please note that you still have to tweak a lot since there is not install manual.

Dependencies

This list is far from complete. You need the python bindings for these packages (if available).

Setting up apache won't be covered here!

Sources

Get the sources:

svn co http://svn.openstreetmap.org/applications/utils/srtm2postgis/
svn co http://svn.openstreetmap.org/sites/other/route-altitude-profile/

Setup the database

First create the database

createdb srtm
createlang plpgsql srtm

Now make it spatial (note that the files can be in a different location on your system):

psql -d srtm -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
psql -d srtm -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql

It could be necessary to create a user

createuser

database_pg.py

You need to create a file (for the import and for the running the service) that is called database_pg.py which contains:

db=""
db_user=""
db_pass=""

Fill in all the fields that you need

Copy this file srtm2postgis/trunk and to route-altitude-profile/trunk/server

srtm2postgis

This package downloads the srtm files and lets you import them into your postgis database.

Download

Run:

python download.py <CONTINENT> <RESUME> <NORTH> <SOUTH> <WEST> <EAST>

Here:

  • <CONTINENT> is one of: Africa, Australia, Eurasia, Islands, North_America or South_America
  • <RESUME> is the file to resume enter 0 if you do not want to resume
  • <NORTH> <SOUTH> <WEST> <EAST> is the bounding box (leave out if you want to download the whole continent). Bounding box must be entered in ints (whole coordinates) so i.e. 10 5 -1 8.

Downloading could take a while.

Import

Assuming the download was succesfull we can now start the import:

python read_data_pg.py <CONTINENT> <EMPTY/NONEMPTY> <NORTH> <SOUTH> <WEST> <EAST>

<CONTINENT> and bounding box should be the same as in Download.

<EMPTY/NONEMPTY> enter empty if you want to empty the database. Enter nonempty if you want to start the import.

route-altitude-profile

Go into the server directory.

Modify altitude-pg.apache2-site-template and create a vhost with it.