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

A week ago, I used Osmosis to import osc files into PostgreSQL with this code:

osmosis --rxc source\osc\xyz.osc --wpc database=gps user=myuser password=mypassword

All went well, and today I tried to run this code with a different osc file, and it failed with this error message:

...

SEVERE: Thread for task 1-rxc failed org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO nodes(id, version, user_id, tstamp, changeset_id, tags, geom) VALUES (?, ?, ?, ?, ?, ?, ?)]; nested exception is org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.util.HashMap. Use setObject() with an explicit Types value to specify the type to use.

...

Can you help solve this? I have a pgsnapshot schema with the linestring.sql, Osmosis version is 0.45, PostgreSQL version is 9.5.6, PostGIS version: 2.3.3

Thank you!

asked 13 Sep '17, 17:14

horvatha's gravatar image

horvatha
11224
accept rate: 0%

i have the same exact error and its driving me crazy!! i wish i can help you but i also posted this question. If i get an answer myself i will be sure to share it with you! Im curious though, you were able to get it work once for you, then now it doesnt work? From the very first time i tried to apply a change file i started receiving this error. The only difference with error is the sql query. Mine is this

[UPDATE nodes SET id = ?, version = ?, user_id = ?, tstamp = ?, changeset_id = ?, tags = ?, geom = ? WHERE id = ?]

(26 Sep '17, 20:07) Asinger321

I installed osmosis 0.40.1 with apt install osmosis and now it works. Installed the pgsnapshot_schema.sql and linestring.sql (version 0.6). No more error messages. Hope it will work for you, too!

(28 Sep '17, 12:09) horvatha

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:

×710
×362
×252
×165
×134

question asked: 13 Sep '17, 17:14

question was seen: 1,799 times

last updated: 28 Sep '17, 12:09

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