Changes between Version 82 and Version 83 of GIS/InstallationGuidelines/Linux


Ignore:
Timestamp:
11/24/10 14:56:21 (11 years ago)
Author:
Fran Boon
Comment:

OSM Rails Port

Legend:

Unmodified
Added
Removed
Modified
  • GIS/InstallationGuidelines/Linux

    v82 v83  
    481481Another option is to serve via WMS (using an Apache module):
    482482 * http://wiki.openstreetmap.org/wiki/Mod_mapnik_wms
     483=== Rails Port ===
     484This is needed to allow editing of the data using Potlatch, JOSM, etc
     485 * http://wiki.openstreetmap.org/wiki/The_Rails_Port
     486
     487{{{
     488apt-get install imagemagick libmagick9-dev
     489apt-get install ruby ruby1.8-dev libxml2-dev libxml-ruby1.8 libxml-parser-ruby1.8 rubygems librmagick-ruby
     490gem install -v=2.3.8 rails
     491#gem install libxml-ruby
     492#gem install composite_primary_keys
     493#gem install rmagick
     494gem install timecop
     495gem install pg
     496gem install oauth
     497
     498#svn co http://railsexpress.de/svn/plugins/sql_session_store/trunk sql_session_store
     499
     500apt-get install postgresql-contrib libpq-dev
     501su postgres
     502createuser openstreetmap -s -P
     503createdb -E UTF8 -O openstreetmap openstreetmap
     504createdb -E UTF8 -O openstreetmap osm_test
     505createdb -E UTF8 -O openstreetmap osm
     506psql -d openstreetmap < /usr/share/postgresql/8.4/contrib/btree_gist.sql
     507
     508apt-get install git
     509cd /home
     510git clone git://git.openstreetmap.org/rails.git
     511cd rails
     512cp config/postgres.example.database.yml config/database.yml
     513vim config/database.yml
     514
     515rake gems:install
     516rake db:migrate
     517env RAILS_ENV=production rake db:migrate
     518rake test
     519
     520osmosis --read-xml-0.6 file="planet.osm.bz2" --write-apidb-0.6 populateCurrentTables=yes host="localhost" database="openstreetmap" user="openstreetmap" password="openstreetmap" validateSchemaVersion=no
     521
     522select setval('acls_id_seq', (select max(id) from acls));
     523select setval('changesets_id_seq', (select max(id) from changesets));
     524select setval('countries_id_seq', (select max(id) from countries));
     525select setval('current_nodes_id_seq', (select max(id) from current_nodes));
     526select setval('current_relations_id_seq', (select max(id) from current_relations));
     527select setval('current_ways_id_seq', (select max(id) from current_ways));
     528select setval('diary_comments_id_seq', (select max(id) from diary_comments));
     529select setval('diary_entries_id_seq', (select max(id) from diary_entries));
     530select setval('friends_id_seq', (select max(id) from friends));
     531select setval('gpx_file_tags_id_seq', (select max(id) from gpx_file_tags));
     532select setval('gpx_files_id_seq', (select max(id) from gpx_files));
     533select setval('messages_id_seq', (select max(id) from messages));
     534select setval('sessions_id_seq', (select max(id) from sessions));
     535select setval('user_tokens_id_seq', (select max(id) from user_tokens));
     536select setval('users_id_seq', (select max(id) from users));
     537
     538cd /home/rails
     539ruby script/server
     540
     541cd db/functions
     542make libpgosm.so
     543
     544    * Log into PgSQL and execute the CREATE FUNCTION statement from maptile.c's comment:
     545
     546 CREATE FUNCTION maptile_for_point(int8, int8, int4) RETURNS int4
     547 AS '/path/to/rails-port/db/functions/libpgosm', 'maptile_for_point'
     548 LANGUAGE C STRICT;
     549
     550 CREATE FUNCTION tile_for_point(int4, int4) RETURNS int8
     551 AS '/path/to/rails-port/db/functions/libpgosm', 'tile_for_point'
     552 LANGUAGE C STRICT;
     553
     554}}}
     555
    483556== Printing ==
    484557For Printing TMS layers, need to compile the Trunk version of the [http://www.mapfish.org/doc/print/ MapFish Print Module] & then serve the resultant .war with [http://tomcat.apache.org Tomcat]: