diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-01-21 14:39:13 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2011-01-21 14:39:13 +0100 |
commit | 7afd4f2c8d623459f4b4d92a38571408ab2daf04 (patch) | |
tree | 773e6ae156d07b5c07a4cd61117b250b3ef5dd01 /README | |
parent | c48ace3cb001659a88483ba5fd4ba3a7721d5c25 (diff) | |
parent | 570d3aa1c9bdebfdbf172f0873d7cda94b89fcaf (diff) | |
download | osm-xapi-7afd4f2c8d623459f4b4d92a38571408ab2daf04.tar.gz osm-xapi-7afd4f2c8d623459f4b4d92a38571408ab2daf04.tar.xz osm-xapi-7afd4f2c8d623459f4b4d92a38571408ab2daf04.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to '')
-rw-r--r-- | README | 58 |
1 files changed, 57 insertions, 1 deletions
@@ -26,7 +26,63 @@ a more formal description We serve the node endpoint, but no others. We implment the tag based filtering, for only one tag and a bounding box. -database shema +Dabase setup +============= + +We use postgres 9.* with postgis 1.5. Postgres 9.0 is used becaus we need some +functions on hstores and postgis 1.5 is used for fancy geometry things. + +To setup a database you first need a runing postgres 9.0 instance. I hope you know +how to do this. + +Use + + createdb osm + +to create a database with name osm. Use + + createlang plpgsql osm + +to add plpgsql to your database. If you want to create a database user do so: + + createuser <username> + +Add hstore support for your database: + + psql -d osm < /share/contrib/hstore.sql + +Add postgis support for your database: + + psql -d osm < /share/contrib/postgis-1.5/postgis.sql + +Just do: + + psql -d osm < /share/contrib/postgis-1.5/spatial_ref_sys.sql + +Create the actual schema for osm data. For this step you need osmosis. If your +osmosis build is correct there should be a directory named pacakge/scripts where +you run: + + psql -d osm < pgsql_simple_schema_0.6.sql + psql -d osm < pgsql_simple_schema_0.6_linestring.sql +Optional/stil to test: + + psql -d osm < pgsql_simple_schema_0.6_action.sql + psql -d osm < pgsql_simple_schema_0.6_bbox.sql + +For documentation on the schema read pgsql_simple.txt. + +Import data from xml with: + + osmosis --read-xml file="planet.osm.bz2" --wp host="localhost" password="TopSecretPassword" user="insertUserNameHere" database="osm" + +Before or after import you may want to create a index or two. Examples below: + CREATE INDEX idx_nodes_tags ON nodes USING GIN(tags); + CREATE INDEX idx_nodes_tags ON nodes USING GIST(tags); + CREATE INDEX idx_ways_tags ON ways USING GIN(tags); + CREATE INDEX idx_ways_tags ON ways USING GIST(tags); + +database shema (out dated) ================ We keep data in a highly specioaliced shema, that allows us to prevent tables |