[OSM-dev] how to setup api/xapi server?

Ian Dees ian.dees at gmail.com
Wed Jan 12 13:50:37 GMT 2011


Here's a first pass at a set of steps I'll refine later in the documentation
for my Java XAPI implementation (I wouldn't mind if you'd like to help
finish that as part of your student project):

1. Download the planet (or other chunk of OSM data)
2. Download a recent copy of Osmosis (
http://dev.openstreetmap.de:23457/hudson/job/osmosis-SNAPSHOT-ant/lastSuccessfulBuild/artifact/trunk/package/distrib/tgzs/
)
3. Unpack osmosis
4. Set up a PostGIS database: (similar to
http://dev.openstreetmap.de:23457/hudson/job/osmosis-SNAPSHOT-ant/lastSuccessfulBuild/artifact/trunk/package/distrib/tgzs/
)
sudo su - postgres
createdb osm
createlang plpgsql osm
createuser <username>
psql -d osm -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
psql -d osm -f
/usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
psql -d osm -f /usr/share/postgresql/8.4/contrib/hstore-new.sql
psql -d osm -f script/pgsnapshot_schema_0.6.sql
psql -d osm -f script/pgsnapshot_schema_0.6_linestring.sql
5. Load the database:
bin/osmosis --read-xml file="osm-data.osm.bz2" --write-pgsql
user="<username>" database="osm" password="osm"

Once this is finished, you should have a database that allows you to
recreate the OSM XML data for bounding boxes of any size. Keep in mind that
using an entire planet with this method will require 360GB or so and take a
few days to import (depending on your disk speed).

On Wed, Jan 12, 2011 at 6:46 AM, Mateusz L <mateuszzz88 at tlen.pl> wrote:

> Hello!
> I am writing student project whitch needs occasionaly download osm data
> (nodes to be exact). Normal API is no-go - sometimes I nead bigger
> boundaries than avilable through API. XAPI hardly ever works, so I decided
> to try and setup it's mirror. I started with
> http://weait.com/content/build-
> your-own-openstreetmap-server and ommited last part (I don't need tiles).
> Now I need some CGI API to fetch XML over HTTP. What(/how) should I use,
> since http://xapi.openstreetmap.org/scripts seems to be permamently down?
> --
> Mateusz
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20110112/a6aaac63/attachment.html>


More information about the dev mailing list