-
Notifications
You must be signed in to change notification settings - Fork 46
json_getter setup
-
grab json_getter.py together with python-based Kothic from code.google.com/p/kothic/source/checkout
hg clone https://kothic.googlecode.com/hg/ kothic cp -r kothic/src /var/www/vtile/
-
install dependencies
apt-get install twms python-psycopg2
if twms not in the repository of your distribution (its currently only in debian testing) install it manually:
hg clone https://twms.googlecode.com/hg/ twms cp -r twms/twms /var/www/vtile/
-
import database with osm2pgsql, according to Mapnik’s manual: wiki.openstreetmap.org/wiki/Mapnik#osm2pgsql
-
import coastline data to database:
shp2pgsql processed_p.shp coastlines | sudo -u postgres psql gis >/dev/null echo 'ALTER TABLE coastlines OWNER TO gis;' | sudo -u postgres psql gis
Alternatively, you can comment coastlines export out from the json_getter script (.extend() calls at the end)
-
set up mod_rewrite redirection, to have cache. for example in /etc/apache2/sites-available/default
<Directory /var/www/vtile/> Options +ExecCGI AddHandler cgi-script .py RewriteEngine on RewriteCond /var/www/%{REQUEST_URI} !-f RewriteRule ^vtile/([0-9]+)/([0-9]+)/([0-9]+)\.js vtile/json_getter.py?z=$1&x=$2&y=$3 </Directory>
don’t forget to enable the rewrite module
a2enmod rewrite
-
add following line in front of the json_getter.py script
#!/usr/bin/python
and allow execution
chmod +x json_getter.py
maybe you have do modify the table names in line 29 if you used another prefix than planet_osm during import.