hello, I'm trying to use osmosis to import data to PostgreSQL, got an error:
This question is marked "community wiki".
asked 17 Apr '15, 13:12 ikenZ
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. answered 19 Apr '15, 15:15 SK53 ♦ |
and, I executed the following command successfully:
thanks for any help!
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.
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)
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.
So it really appears to be your PostgreSQL environment. I suspect it is something as simple as the password or read/write permissions somewhere.
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.
Not what I expected! Well done. I'm grabbing bits & pieces of this conversation to convert into an answer.