My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

The OSMqa project wants to provide a simple Quality Assurance system, so that people can work together on improving OSM data without going twice to the same already-mapped place.

Requirements

On a debian-based system (package versions may differ):

 sudo apt-get install postgis postgresql-8.4-postgis libapache2-mod-fcgid libapache2-mod-python
 sudo apt-get install libapache2-mod-wsgi cgi-mapserver mapserver-bin python2.6 python2.6-dev 
 sudo apt-get install libgeos-3.1.0 python-setuptools gcc-4.3 libpq-dev
 sudo a2enmod expires headers fcgid python
 sudo easy_install Shapely psycopg2

Before creating the database, I suggest you have a look at the docs/OPTIMIZATIONS.txt file. This should help save a lot of your precious time.

Installation

 svn checkout http://osmqa.googlecode.com/svn/trunk/ osmqa
 cd osmqa

SQL

We first create the database and spatially enable it:

 sudo su postgres
 createdb -E UTF-8 osmqa
 createlang plpgsql osmqa

Depending on your postgresql version, you should either :

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

or:

 psql -d osmqa -f /usr/share/postgresql/8.4/contrib/postgis.sql
 psql -d osmqa -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql

Then, go to http://openlayers.org/dev/examples/vector-formats.html, select WKT format, input proj = epsg:4326, output proj = spherical mercator, and draw a polygon surrounding the area you want to survey, copy the generated WKT string and paste it into scripts/area.py

 cd scripts
 python generate_tiles.py

This generates a (big) sql/generated/tiles.sql file

Next, we want to use shorelines to filter out vector tiles which do not intersect lands. This step is optional.

 wget http://tile.openstreetmap.org/processed_p.tar.bz2
 tar xvjf processed_p.tar.bz2

We then convert the resulting shapefile into SQL:

 shp2pgsql -s 900913 -g geometry -I processed_p.shp processed_p > /tmp/processed_p.sql

Finally, SQL files are inserted:

 sudo su postgres
 cat /tmp/processed_p.sql sql/osmqa.sql sql/generated/tiles.sql | psql -d osmqa

App install

Bootstrap your project:

 python bootstrap.py --version 1.5.2 --distribute

Create your config file:

 cp buildout_sample.cfg buildout_myconfig.cfg

Edit the [vars] section of buildout_myconfig.cfg to match your setup (database, servername ...)

Install your project and its dependencies:

 buildout/bin/buildout -c buildout_myconfig.cfg

If necessary, create your db user (we assume "www-data" here):

 sudo su postgres
 createuser -p 5432 -S -D -R -I -P "www-data"

Grant rights to your db user:

 psql -d osmqa -f sql/grants.sql
 exit

Optionally, we want to delete tiles above the oceans:

 python scripts/intersectsland.py

(this can take a long time)

Quick test to check everything's ok :

 ./buildout/bin/paster  serve --reload myproject_dev.ini

Open http://localhost:5000/tiles?limit=1 You should see a nice GeoJSON string !

Apache configuration

A very simple apache virtual host config file has been created during project setup (apache/osmqa.conf.vhost). You can choose to use it (or not):

 cd /etc/apache2/sites-available/
 sudo ln -s $yourdir/apache/osmqa.conf.vhost osmqa (where $yourdir is the place you have installed the project)
 sudo a2ensite osmqa
 sudo /etc/init.d/apache2 restart

... and you're done with it !

Powered by Google Project Hosting