NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

I have problems to follow the examples on: http://wiki.openstreetmap.org/wiki/Osmosis

While I am trying to start: 'osmosis --read-xml file="myosm.osm" --write-apidb host="localhost" database="postgis" user="postgres" password="xxx"' I get the following errors.

The database is fresh and clean. My OS is Win x64

Here is the exception trace:

SCHWERWIEGEND: Thread for task 1-read-xml failed org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to create resultset. at org.openstreetmap.osmosis.apidb.common.DatabaseContext.executeQuery(DatabaseContext.java:429) ...etc... at java.lang.Thread.run(Unknown Source) Caused by: org.postgresql.util.PSQLException: FEHLER: Relation +schema_migrations½ existiert nicht Position: 21 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) ...etc... at org.openstreetmap.osmosis.apidb.common.DatabaseContext.executeQuery(DatabaseContext.java:424)

asked 09 May '11, 09:49

asdfasdfasdf's gravatar image

asdfasdfasdf
1111
accept rate: 0%

edited 10 May '11, 12:07

TomH's gravatar image

TomH ♦♦
3.3k83943


Have a look at this answer http://help.openstreetmap.org/questions/4331/error-loading-the-osm-file-into-the-database. You do not appear to have installed the database tables in PostGIS.

permanent link

answered 09 May '11, 10:17

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

Is there a complete script/application for windows? 'http://wiki.openstreetmap.org/wiki/Osmosis/PostGIS_Setup' and especially the 9.04 section is useless for windows because of environment variables/ user restrictions and other things.

(09 May '11, 19:03) asdfasdfasdf

The standard PostGIS tools work for me under Windows. Perhaps try with cygwin, or use pgadmin & copy paste DDL into query window. In general its usually best to run things either with full paths or a specially constructed PATH within a DOS shell.

(09 May '11, 21:23) SK53 ♦

Can you tell me which files i have to paste into pgadmin. I already tried some of these. Especially the last one did not create the right shema (simple or something) for me.

hstore.sql postgis.sql spatial_ref_sys.sql pgsql_simple_schema_0.6.sql

(09 May '11, 22:06) asdfasdfasdf

I suggest you raise a new question for this: documentation for getting things working on windows is usually poor. Frequently bits of OSM software don't work on Windows for trivial reasons such as assuming "/" is the separator of directory and filenames. Therefore a broader question is likely to be of more use to everyone.

Quickly, you need to install in this order postgis, hstore, either simple schema or the api schema. I don't know if you need spatial_ref_sys, but its easy to check by trying to load an empty or dumpy osm xml file.

(10 May '11, 10:19) SK53 ♦

You've tried loading the data into the format used by the "Rails Port" by using the --write-apidb flag. Osmosis is checking for the tables it expects to find, but you say you have a clean database so it's failing. Note that the apidb format is designed for use with the web front end and only uses Postgres types (i.e. no spatial columns) so might not be what you are looking for.

You need to decide what format you want the tables to be in, since osmosis supports a few different database structures. These can be chosen with the following options.

  • --write-apidb
  • --write-pgsql
  • --write-pgsimp

You need to investigate and decide which is the most appropriate. In every case you need to have the correct database tables set up before loading with osmosis. Instructions are available on the Osmosis Detailed Usage page.

For loading data into postgres for use with mapnik you should look at osm2pgsql instead, which uses yet another choice of table layouts.

permanent link

answered 10 May '11, 16:50

Andy%20Allan's gravatar image

Andy Allan
12.5k23128153
accept rate: 28%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×252
×196
×165
×84
×6

question asked: 09 May '11, 09:49

question was seen: 10,998 times

last updated: 25 Feb '12, 17:58

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum