[OSM-dev] Schema version problem with osmosis & postgresql/postgis

Sarah Hoffmann lonvia at denofr.de
Tue May 31 15:57:37 BST 2011


Hi,

On Tue, May 31, 2011 at 03:25:15PM +0200, Benjamin Meier wrote:
> I want to setup a Postgresql/postgis DB and fill it with data from a  
> xml-file using osmosis. For this I'm using this tutorial:
> http://wiki.openstreetmap.org/wiki/Osmosis_PostGIS_Setup
>
> I'm using Ubuntu 10.10 with Postgresql-8.4 and osmosis-0.39
>
> I followed the instructions from the tutorial to setup the database and  
> edited some paths to match with my filesystem.
>
> sudo su - postgres
> createdb osm
> createlang plpgsql osm
> createuser user
>
> 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.sql
> psql -d osm -f  
> /home/benny/Desktop/DA/programme/osmosis-0.39/script/pgsimple_schema_0.6.sql
>
> Those commands worked without errors.
>
> When I run osmosis with:
> ./osmosis --read-xml file="/media/daten/osm/someplace.osm" --write-pgsql  
> user="user" database="osm" password="osm"

You are mixing two different schemata. If you initialise the database
with pgsimple_schema_0.6.sql, you need to import with '--write-pgsimp'.
For '--write-pgsql' you need to initialise the database with the
pgsnapshot_schema_0.6.sql script. See also
http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage#PostGIS_Tasks_.28Snapshot_Schema.29

The main difference is that the snapshot schema uses hstore for tags
while pgsimple uses a simple table. I'd recommend using pgsnapshot.

Sarah



More information about the dev mailing list