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

Hello, I downloaded europe-latest.osm.pbf from geofabrik last night. I am using OSMOSIS 0.45 version and trying to extract an area (an extended version of Isle Of Man for test) from europe download using OSMOSIS with the following command

osmosis   --read-pbf file=europe-latest.osm.pbf   --bounding-box left=-4.85 top=54.45 bottom=54.025 right=-4.25 --write-pbf Test.osm.pbf omitmetadata=true

get the following error after it runs for about 13 minutes:

Jan 05, 2017 10:34:34 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.45
Jan 05, 2017 10:34:35 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Jan 05, 2017 10:34:35 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Jan 05, 2017 10:34:35 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
java.util.zip.DataFormatException: invalid distance too far back
        at java.util.zip.Inflater.inflateBytes(Native Method)
        at java.util.zip.Inflater.inflate(Unknown Source)
        at java.util.zip.Inflater.inflate(Unknown Source)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockPosition.parseData(FileBlockPosition.java:57)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockHead.readContents(FileBlockHead.java:95)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlock.process(FileBlock.java:135)
        at org.openstreetmap.osmosis.osmbinary.file.BlockInputStream.process(BlockInputStream.java:34)
        at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:45)
        at java.lang.Thread.run(Unknown Source)
Jan 05, 2017 10:47:18 AM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-pbf failed
java.lang.Error: java.util.zip.DataFormatException: invalid distance too far back
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockPosition.parseData(FileBlockPosition.java:60)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockHead.readContents(FileBlockHead.java:95)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlock.process(FileBlock.java:135)
        at org.openstreetmap.osmosis.osmbinary.file.BlockInputStream.process(BlockInputStream.java:34)
        at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:45)  
      at java.lang.Thread.run(Unknown Source)Caused by: java.util.zip.DataFormatException: invalid distance too far back
        at java.util.zip.Inflater.inflateBytes(Native Method)
        at java.util.zip.Inflater.inflate(Unknown Source)
        at java.util.zip.Inflater.inflate(Unknown Source)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockPosition.parseData(FileBlockPosition.java:57)
        ... 5 more

Jan 05, 2017 10:47:18 AM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.
        at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
        at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
        at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

when I do the same using the europe download from august of 2016, it works just fine. Is there a newer version of OSMOSIS that I need to download?

asked 05 Jan '17, 17:06

kcjailbirds's gravatar image

kcjailbirds
141131319
accept rate: 0%

edited 05 Jan '17, 20:45

scai's gravatar image

scai ♦
33.3k21309459

1

Also, working in a windows 7 64 bit environment and running java 1.8.0_101.

(05 Jan '17, 21:02) kcjailbirds

I think I fixed it. I am not sure why the error above has anything todo with the java heap size but I modified the OSMOSIS.bat file and added parameter to change the heap size that java uses to 1G and it works now.

SET EXEC="%JAVACMD%" -Xmx1024m -cp "%PLEXUS_CP%" -Dapp.home="%MYAPP_HOME%" -Dclassworlds.conf="%MYAPP_HOME%\config\plexus.conf" %MAINCLASS% %OSMOSIS_OPTIONS% %*

permanent link

answered 06 Jan '17, 15:35

kcjailbirds's gravatar image

kcjailbirds
141131319
accept rate: 0%

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

question asked: 05 Jan '17, 17:06

question was seen: 3,613 times

last updated: 06 Jan '17, 15:35

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