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

I use nohup osmosis --read-pbf /mnt/planet/planet-latest.osm.pbf --write-apidb host="localhost" database="openstreetmap" user="osm" password="osm" validateSchemaVersion="no command to import data into openstreetmap database three days ago, today , the command failed by following error:

十二月 15, 2016 3:31:01 上午 org.openstreetmap.osmosis.core.Osmosis run
信息: Osmosis Version 0.40.1
十二月 15, 2016 3:31:01 上午 org.openstreetmap.osmosis.core.Osmosis run
信息: Preparing pipeline.
十二月 15, 2016 3:31:01 上午 org.openstreetmap.osmosis.core.Osmosis run
信息: Launching pipeline execution.
        at crosby.binary.osmosis.OsmosisBinaryParser.parseWays(OsmosisBinaryParser.java:172)
        at crosby.binary.BinaryParser.parse(Unknown Source)
        at crosby.binary.BinaryParser.handleBlock(Unknown Source)
        at crosby.binary.file.FileBlock.process(Unknown Source)
        at crosby.binary.file.BlockInputStream.process(Unknown Source)
        at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:37)
        at java.lang.Thread.run(Thread.java:745)
**Caused by**: org.postgresql.util.PSQLException: ERROR: cannot have more than 2^32-1 commands in a transaction
  在位置:SQL statement "SELECT 1 FROM ONLY "public"."ways" x WHERE "way_id" OPERATOR(pg_catalog.=) $1 AND "version" OPERATOR(pg_catalog.=) $2 FOR KEY SHARE OF x"
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363)
        at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushWayTags(ApidbWriter.java:723)
        ... 12 more

It has import 821GB data into the database, and this makes me lose hope to import the planet data successfully, please help me. The osmosis version is 0.40.1, should i use the latest version 0.45 to re-run the command again?

asked 18 Dec '16, 01:59

yuyy's gravatar image

yuyy
236222431
accept rate: 20%

edited 18 Dec '16, 09:06

scai's gravatar image

scai ♦
33.3k21309459

org.postgresql.util.PSQLException: ERROR: cannot have more than 2^32-1 commands in a transaction -> This is a bug in osmosis: https://trac.openstreetmap.org/ticket/4597 .Unfortunately still open, at least according to the ticket. However version 0.40.1 is very very old. I think there is a valid chance that the newest version doesn't produce this error any more.

(18 Dec '16, 09:09) scai ♦
1

I use the newest version 0.45 to re-run the command, but the error appears again, what should i do, Is there any other solution to import the planet data into the database?

(22 Dec '16, 02:53) yuyy
1

Yes, for example using osm2pgsql. It really depends on your use-case. See https://wiki.openstreetmap.org/wiki/Databases_and_data_access_APIs#Database_Schemas

(22 Dec '16, 11:39) scai ♦

How to use osm2pgsql to import planet data into the openstreetmap database? What's the command if i just need the updatable schemas? I have installed the rails port, and i need to display the detail message after i use nominatiom to search a place name.

(22 Dec '16, 14:56) yuyy

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
×13
×7

question asked: 18 Dec '16, 01:59

question was seen: 1,758 times

last updated: 22 Dec '16, 14:56

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