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

0
1

hello, I'm trying to use osmosis to import data to PostgreSQL, got an error: alt text

 I don't know what caused, what do you think?
This question is marked "community wiki".

asked 17 Apr '15, 13:12

ikenZ's gravatar image

ikenZ
16112
accept rate: 0%

wikified 19 Apr '15, 08:00

and, I executed the following command successfully: alt text

thanks for any help!

(17 Apr '15, 13:15) ikenZ
2

The sensible test is to use a --wn (write null) to ensure that the xml file is properly readable. Given that part of the error message is from a pgsql component I'd tentatively suggest the problem lies not with --rx, but with the --write-pgsimp stage. Try writing to the DB with an empty OSM file.

(17 Apr '15, 16:06) SK53 ♦

I really appreciate your help very much! and, I did two tests you suggested: 1,osmosis --read-xml beijing_china.osm --wn 2,osmosis --read-xml null.osm -write-pgsimp ... (null.osm is an empty osm file)

(18 Apr '15, 01:34) ikenZ

the first ran successfully, but the second also failed with error infomation 'unable to execute statement'. and, the environment: PostgreSQL9.3 + Postgis2.1 + the latest vesion of osmosis. my os is win8.1 I setup the environment on another machine, failed with the same error,too.

(18 Apr '15, 01:40) ikenZ
1

So it really appears to be your PostgreSQL environment. I suspect it is something as simple as the password or read/write permissions somewhere.

(18 Apr '15, 11:20) SK53 ♦
3

I made it! And I particularly appreciate your suggestions. The reason of the error is the way of extension of postgis. I used the command 'psql -d osmdb -f D:\PostgreSQL9.3\share\contrib\postgis-2.1' to extend, then import data failed. when I replaced it with the command 'CREATE EXTENSION postgis;', the import ran successfully.

(19 Apr '15, 07:59) ikenZ

Not what I expected! Well done. I'm grabbing bits & pieces of this conversation to convert into an answer.

(19 Apr '15, 15:14) SK53 ♦
showing 5 of 7 show 2 more comments

When running into errors with Osmosis it is often difficult to disentangle where the error is occurring. The sensible test is to use a --wn (write null) to ensure that the xml file is properly readable. The obverse test is to start with an empty OSM file to check the latter part of the pipeline.

Given that part of the error message is from a pgsql component I'd tentatively suggest the problem lies not with --rx, but with the --write-pgsimp stage.

permanent link

answered 19 Apr '15, 15:15

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

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
×230
×196

question asked: 17 Apr '15, 13:12

question was seen: 3,644 times

last updated: 19 Apr '15, 15:15

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