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

Hi! I'm having a goal to be able to use osm data offline, if I travel somewhere - I just get a small rectangle part (a city - about 4 square degrees of latitude/longitude) from a big planet.osm.pbf and load it in some program (for now I came to Maperitive, but not sure if it would work). I wonder how fast such map would render on an average notebook, how long would it take to export a city from planet file, what should I write in osmosis console and if maybe there are better solutions.

I'm asking about exact code to write, because I've already tried
bin\osmosis.bat --read-pbf file=planet-140122.osm.pbf enableDateParsing=no --log-progress interval=30 --bounding-box top=60.5700 left=29.1900 bottom 58.5700 right=31.1900 --write-pbf file=sanktpeterburg.osm.pbf

and got errors. Thanks for help in advance.

F:\osmosis>bin\osmosis.bat -v --read-pbf file=planet-140122.osm.pbf enableDatePa
rsing=no --buffer --log-progress interval=30 --bounding-box clipIncompleteEntiti
es=true top=60.5700 left=29.1900 bottom=58.5700 right=31.1900 --write-pbf file=s
anktpeterburg2.osm.pbf
 эт 29, 2014 1:12:31 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.43.1
 эт 29, 2014 1:12:31 AM org.openstreetmap.osmosis.core.TaskRegistrar loadJPFPlug
ins
FINE: Searching for JPF plugins.
 эт 29, 2014 1:12:31 AM org.openstreetmap.osmosis.core.TaskRegistrar loadJPFPlug
ins
FINE: Registering the core plugin.
 эт 29, 2014 1:12:31 AM org.openstreetmap.osmosis.core.TaskRegistrar loadJPFPlug
ins
FINE: Registering the extension plugins.
 эт 29, 2014 1:12:31 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
 эт 29, 2014 1:12:31 AM org.openstreetmap.osmosis.core.pipeline.common.Pipeline
prepare
FINE: Building tasks.
 эт 29, 2014 1:12:31 AM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Argument enableDateParsi
ng for task 1-read-pbf was not recognised.
        at org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory.cre
ateTaskManager(TaskManagerFactory.java:64)
        at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.buildTasks(Pi
peline.java:50)
        at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.prepare(Pipel
ine.java:112)
        at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:86)
        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(Laun
cher.java:329)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:239)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

Added:

F:\osmosis>bin\osmosis.bat --read-pbf file=planet-140122.osm.pbf --log-progress
interval=30 --bounding-box clipIncompleteEntities=true top=60.5700 left=29.1900
bottom=58.5700 right=31.1900 --write-pbf file=sanktpeterburg2.osm.pbf
 эт 29, 2014 1:06:08 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.43.1
 эт 29, 2014 1:06:09 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
 эт 29, 2014 1:06:09 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
 эт 29, 2014 1:06:09 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
java.util.zip.DataFormatException: incorrect data check
        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(F
ileBlockHead.java:95)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlock.process(FileBlock.
java:135)
        at org.openstreetmap.osmosis.osmbinary.file.BlockInputStream.process(Blo
ckInputStream.java:34)
        at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:45)
        at java.lang.Thread.run(Unknown Source)
 эт 29, 2014 1:06:10 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTas
kManager waitForCompletion
SEVERE: Thread for task 1-read-pbf failed
java.lang.Error: java.util.zip.DataFormatException: incorrect data check
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockPosition.parseData(
FileBlockPosition.java:60)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlockHead.readContents(F
ileBlockHead.java:95)
        at org.openstreetmap.osmosis.osmbinary.file.FileBlock.process(FileBlock.
java:135)
        at org.openstreetmap.osmosis.osmbinary.file.BlockInputStream.process(Blo
ckInputStream.java:34)
        at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:45)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.util.zip.DataFormatException: incorrect data check
        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

 эт 29, 2014 1:06:10 PM 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.waitForComple
tion(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(Laun
cher.java:329)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:239)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

asked 28 Jan '14, 19:45

kuzma1's gravatar image

kuzma1
16113
accept rate: 0%

edited 29 Jan '14, 10:57

I might be tempted to start with an extract of the European part of Russia rather than the whole planet.

(28 Jan '14, 20:02) SomeoneElse ♦

Also, what version of Osmosis are you running (i.e. how old is it) and what errors do you actually get?

(28 Jan '14, 20:04) SomeoneElse ♦

How can I make such exports myself from a planet.pbf? Can you just provide me with WORKING code? I'm using the latest versions of all programs.

(28 Jan '14, 20:23) kuzma1
2

The last time I ran osmosis I did:

osmosis  --read-pbf great-britain-latest.osm.pbf  --bounding-box top=54.623 left=-4.807 bottom=51.737 right=0.906 --write-pbf cut.pbf

and it produced just what I wanted. That was on Linux rather than Windows, but should be otherwise the same. I notice that your example has "bottom 58.5700" - did you really miss the "=" sign out?

(28 Jan '14, 20:42) SomeoneElse ♦

The error

java.util.zip.DataFormatException: incorrect data check

suggests that there's a problem with the pbf file that you're trying to read. If you run md5sum on it (you'll need to download a version of that for Windows) does it match the values in the .md5 file on http://planet.openstreetmap.org/pbf/ ?

permanent link

answered 29 Jan '14, 11:05

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

1

Yeah, that was a problem. Now it executes, quite slow (the file sanktpetersburg2.osm.pbf grows about 100kbytes in minute - in console it tells ~95000 objects per second). Is it normal for 4gb ram on ultrabook? I already changed xmx in java settings to three quarters of my ram.

(29 Jan '14, 13:26) kuzma1

Alright, it's nice, it took a little more than an hour. Map renders quite slow, guess it would be better to use other map formats, but I guess my question resolved, how can I accept an answer?

(29 Jan '14, 15:56) kuzma1

I've changed the "comment" suggesting that there might be a problem with the data to an "answer" - you should be able to accept that now.

(29 Jan '14, 16:00) SomeoneElse ♦

Thanks for help

(29 Jan '14, 17:03) kuzma1

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:

×315

question asked: 28 Jan '14, 19:45

question was seen: 10,019 times

last updated: 29 Jan '14, 17:03

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