hello,
I'm trying to use osmosis to import data to PostgreSQL, got an error:
I don't know what caused, what do you think?
asked
17 Apr '15, 13:12
ikenZ
16●1●1●2
accept rate:
0%
wikified
19 Apr '15, 08:00
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.
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:
osmosis ×239
data ×215
import ×184
question asked: 17 Apr '15, 13:12
question was seen: 2,681 times
last updated: 19 Apr '15, 15:15
Import more osm files in to Nominatim
Nominatim update sql error in placex_update
How do I give Osmosis more temporary storage.
incorrect data check
how to import big data?
Help with Osmosis API
How can I import data to OSM from a .csv file?
How to get data for two countries ?
Error while following osmosis import to database examples
How can I make my location data available so OSM developers can include my locations if they choose?
First time here? Check out the FAQ!