osm.pbf map convertion problem

114 views
Skip to first unread message

Danfeng Yang

unread,
Feb 22, 2017, 3:56:26 AM2/22/17
to mapsforge-dev
I downloaded china.map from your website, but the map shows english and chinese location names at the same time. So i use osmosis and map-writer plugin to convert chian-latest.osm.pbf to china.map with preferred language=CN. Is this the right way to solve this problem?
I also occurred problem using osmosis and map-writer plugin.error info:
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(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Laun
cher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:238)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

please help me,thx a lot!

Emux

unread,
Feb 22, 2017, 4:03:18 AM2/22/17
to mapsfo...@googlegroups.com
The correct option with latest map-writer would be "preferred-languages" and setting an ISO 639-1 language (they're in lowercase).

But if you don't set that option then the default language (usually being the local) will be used.

Regarding the exception could you post the command line you used and the full exception log, in order to understand what happens?

--
Emux

Danfeng Yang

unread,
Feb 22, 2017, 10:26:45 PM2/22/17
to mapsforge-dev
I used china.map that your official website provide,and the map shows english location names at first,zoom out it shows chinese names. Is the china.map converted without setting preferred language?if so,it should show chinese names rather than english and chinese names at the same time
here is the error info:
C:\>osmosis --rb china-latest.osm.pbf --mapfile-writer file=china.map type=hd pr
eferred-languages=CN bbox=31.14,118.22,32.37,119.14
信息: start writing file...
二月 22, 2017 9:26:02 下午 org.mapsforge.map.writer.util.GeoUtils clipToTile
警告: invalid geometry prior to tile clipping, trying to repair 416935546
二月 22, 2017 9:26:02 下午 org.mapsforge.map.writer.util.GeoUtils clipToTile
警告: invalid geometry even after attempt to fix 416935546

this is cmd not having bbox
C:\>osmosis --rb china-latest.osm.pbf --mapfile-writer file=china.map type=hd pr
eferred-languages=cn
二月 23, 2017 11:10:46 上午 org.openstreetmap.osmosis.core.Osmosis run
信息: Osmosis Version 0.45
二月 23, 2017 11:10:46 上午 org.openstreetmap.osmosis.core.Osmosis run
信息: Preparing pipeline.
二月 23, 2017 11:10:47 上午 org.mapsforge.map.writer.osmosis.MapFileWriterTask <
init>
信息: mapfile-writer version: mapsforge-map-writer-0.7.0
二月 23, 2017 11:10:47 上午 org.mapsforge.map.writer.osmosis.MapFileWriterTask <
init>
信息: mapfile format specification version: 3
二月 23, 2017 11:10:47 上午 org.openstreetmap.osmosis.core.Osmosis run
信息: Launching pipeline execution.
二月 23, 2017 11:10:47 上午 org.openstreetmap.osmosis.core.Osmosis run
信息: Pipeline executing, waiting for completion.
二月 23, 2017 11:10:47 上午 org.mapsforge.map.writer.osmosis.MapFileWriterTask p
rocess
严重: No valid bounding box found in input data.
Please provide valid bounding box via command line parameter 'bbox=minLat,minLon
,maxLat,maxLon'.
Tile based data store not initialized. Aborting...
二月 23, 2017 11:10:47 上午 org.openstreetmap.osmosis.core.pipeline.common.Activ
eTaskManager waitForCompletion
严重: Thread for task 1-rb failed
java.lang.IllegalStateException: tile based data store not initialized, missing
bounding box information in input data
at org.mapsforge.map.writer.osmosis.MapFileWriterTask.process(MapFileWri
terTask.java:157)
at crosby.binary.osmosis.OsmosisBinaryParser.parseDense(OsmosisBinaryPar
ser.java:138)
at org.openstreetmap.osmosis.osmbinary.BinaryParser.parse(BinaryParser.j
ava:124)
at org.openstreetmap.osmosis.osmbinary.BinaryParser.handleBlock(BinaryPa
rser.java:68)
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(Thread.java:745)

Ludwig

unread,
Feb 22, 2017, 10:44:11 PM2/22/17
to mapsfo...@googlegroups.com
I have not looked at this in detail, but I am aware that across China there is a mix-up between Chinese and English names, sometimes to the extent that people who try to be 'helpful' put both a Pinyin and Chinese name together in the name field. 

Could you check with the OSM source if this is the case?




--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mapsfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mapsforge-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/e5410acd-3697-45b1-8c36-dfde7917ee89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Emux

unread,
Feb 23, 2017, 3:01:40 AM2/23/17
to mapsfo...@googlegroups.com
On 23/02/2017 05:26 πμ, Danfeng Yang wrote:
I used china.map that your official website provide,and the map shows english location names at first,zoom out it shows chinese names. Is the china.map converted without setting preferred language?

Which map exactly from the server, as some countries have also multilingual maps.

Regular maps have as preferred language the English, while multilingual have the local language and en,de,fr,es.

You can open a map file with Cruiser and use the "Tools" - "Map info" menu to see its properties.

Also as Ludwig mentioned, all depend on what users have put in OpenStreetMap data at "name", "name:en" and other name tags (see documentation).
e.g. putting English names in "name" instead of local


Regarding map-writer you posted two command lines.
2nd fails because it requires a bounding box parameter.

What's the problem with 1st?
I see geometry clip warnings, which don't normally halt map build.

BTW what's your proper local language according to ISO 639-1 standard?
(see OpenStreetMap wiki)

--
Emux

Danfeng Yang

unread,
Feb 23, 2017, 8:06:53 PM2/23/17
to mapsforge-dev
that is really help,we gonna try it again,thx for your kindness!

小璋丸

unread,
Apr 18, 2017, 5:31:05 AM4/18/17
to mapsforge-dev
This is my implementation.
# 合併 OSM 圖資與海岸線圖資
$ osmosis \
  --rb file='taiwan-latest.osm.pbf' \
  --rx file='taiwan-coastline/taiwan-coastline.osm' --s --m \
  --wb file='taiwan-merged.osm.pbf' omitmetadata='true'

# 合併後圖資轉檔為 mapsforge 圖資 (約 7 分鐘)
$ osmosis \
  --rb file='taiwan-merged.osm.pbf' \
  --mw file='taiwan-taco.map' tag-conf-file='taiwan-tag-mapping.xml' \
       bbox='20.627996,118.150901,26.703049,123.031181'

# 縮小範圍查詢 (約 7 秒) - 測試 taiwan-tag-mapping.xml 設定值使用
$ osmosis \
  --rb file='taiwan-merged.osm.pbf' \
  --bb bottom='25.050769' left='121.530762' top='25.055745' right='121.536255' \
  --mw file='taiwan-taco.map' tag-conf-file='taiwan-tag-mapping.xml' \
       bbox='25.050769,121.530762,25.055745,121.536255'
Reply all
Reply to author
Forward
0 new messages