Talk:OSM Mobile Binary Protocol

From OpenStreetMap Wiki
Jump to: navigation, search

Contents

Existing protocols

See also the rather flexible design of OpenDMTP (Open Device Monitoring and Tracking Protocol) protocol for minimizing the traffic when communicating to OpenGTS (Open GPS Tracking System) --Stefanb 15:41, 27 September 2007 (BST)

Interesting this takes things to a lower level, tcp/udp packets, maybe for a future binary api... Also they scale lat/lon values to fill the integer range, giving higher accuracy than the 6dp in the suggested binary api, but only claim it to be good to 5dp perhaps you get more rounding errors? --Adamboardman 20:15, 28 September 2007 (BST)

Diff

Stefanb: How compact is the osmosis diff format? You indicated that it could just be adopted as a binary protocol?

It is bloated XML (*.osc), and should be somehow close to .osm file (in terms of tags...), so same principles could be employed for shrinking the diff. Grab an example from [1] --Stefanb 16:05, 28 September 2007 (BST)
Ok have improved diff description, osmosis probably not particularly useful as we work from OSM API not planet files. But yes a binary diff is definitely something we need. Perhaps all we need to add for the output is a list of deleted poi's and deleted ways (any mentioned will be added). Though more complicated things could be done in terms of only sending changed parts of nodes/ways etc. --Adamboardman 19:56, 28 September 2007 (BST)

bmap.php

Erik: In revision 807 (and earlier) I have a problem. The area which I request (tile=436829705 ts=29; tile=1747318821 ts=31) is not complete. My client is receiving half of the requested area. After changing the value $remaining=1024 to $remaining=4096 I receive the complete tile.

Not something I've noticed, that value should only configure the chunk size for downloading content, so it would indicate that there are issues around adding two chunks together? --Adamboardman 14:24, 12 October 2007 (BST)
Latest bmap.php (now only 0.5 API is supported) has an extra check that removes a lot more nodes taking the tile you mention from: 49421 to 17093 --Adamboardman 15:04, 12 October 2007 (BST)

I don't understand...

Hi, I'm trying to implement this but I find the spec a bit confusing. Quote:

To enable noticing deleted items, ways that have been omitted due to use of the have parameter are listed in an omitted field listing just the id's. Node - length n id lon lat nodepropenumval {propkeyid (enumval | valsignedint | packedtime | strlen str)}
BlnBnBidBBlonBlatE
BlnBnBidBBlonBlatEILString Of Text
BlnBn...

What are all those Bs? Double Bs? E? EIL? BlnBwBidBBnuBBloBBatB...IEILA9? Literals? Or are the ln, w, id, ... literals? Neither of them are? --SLi 00:05, 20 October 2007 (BST)

I've added further details to the spec, you may find it easier to look at the php example code (and php.net/pack to find out what the coding letters mean), but B merely indicated Binary data, and the the idea was to occupy 4 bytes so 'Binary Block Length' => 'BlnB'. The IEILA9 you query is 'Property Key Id Highway (I), Enum value for primary(E), Property Key Id Ref (I), Length (L), A9 (utf8 text)'. Hope that helps. For interest what are you working on? --Adamboardman 16:47, 21 October 2007 (BST)

Analysis : Viability of Mobile protocol

The alternative to a mobile protocol is a "download (partial) planet to flash" approach.

Which is best ? The important questions are :

So IMO, although a mobile protocol will represent an extraordinary achievement, it will not be extremely useful. -- Nic 22:11, 21 October 2007 (BST)

  • In the limited (connected) devices you don't always have the room for whole (and growing) planet, or even the subset that one might someday be interested in.
  • Even if you do have plenty of room or free bandwidth, it's probably wise to compress it efficiently - as this binary protocol does.
  • Even with unlimited GSM data plans or broadband it probably is desired to have the needed data downloaded as fast as possible (imagine driving and waiting for the new section of the map to appear, or waiting for the maps in 100km radius to be downloaded so that you can do your routing).
  • With compressed (=cheap) downloads you can also easily delete whatever you didn't need recently to save space, or do frequent updates on the road (more convenient than thinking about it in advance at home every week).
--Stefanb 09:51, 22 October 2007 (BST)

Reduced Data OSM

A discussion started by bvh on #osm suggesting removal of ways got me thinking about the best way to store the minimum data to represent what we want. Whilst I dont agree with bvh I think there is room for improvement in this area.

Stored data:

Representing reality:

Editor interface:

Automated migration:

Backwards compatibility:

Prerequisites: Full support for relations (currently unsupported by many editors/renderer's including WhereAmI/PHPProxy)

PHPProxy(osmgetbmap.php) now supports relations, and has the ability to filter out properties applied to linked relations from ways/nodes, currently disabled until WhereAmI supports relations (other users could enable it for their usage though) --Adamboardman 09:43, 29 December 2007 (UTC)

protocol comments

Nope don't have any yet... with adding things at the end of enums and not doing things like you request below we'd not need them... --Adamboardman 19:07, 15 November 2007 (UTC)
That would be more of a storage format, and feel free to parse it and save it with padding, but why pay for the extra bytes if you dont have to, were talking x pounds per meg downloads on mobile phones here! The cost you mention is minimal assuming the data is in RAM on the device, the other end of the process of writing the data to a db in persistent flash in the device, now that is costly. --Adamboardman 19:07, 15 November 2007 (UTC)
An omission, no particular need but just indicated that it was a list of id's relating to ways --Adamboardman 19:07, 15 November 2007 (UTC)

Servers?

Is there a URL for getting recent data in this format? Ojw 18:21, 18 December 2007 (UTC)

The next release of WhereAmI (v0.08) will be offering this click able tile selector: http://www.symbianos.org/post.php?nav=osmtileselector (don't click too many tiles unless you intend to use them - even then importing more than 400k of tiles in one go may not be possible depending on phone memory) --Adamboardman 09:27, 29 December 2007 (UTC)

Error or feature?

Im working with this protocol. All was fine but some days ago it has changed. The length of UTF8 strings(i.e. ways names) become incorrect as i understand. In english all fine but in other languages there are some problems.

In english language string with 10 characters occupies 10 bytes in UTF8. But i.e. in russian language string with 10 characters may occupy 15 bytes in UTF8. BUT!!! The length of the ways name, which i receive, is 10(not 15). And i think this is error. I repeat - couple of weeks ago all was fine. Name of UTF8 was send count of bytes(15) and now it sends count of characters(10).

That why even ur program whereami works incorrect with russian names.

I hope u will fix it.

Thank u very much, big respect for ur job.

Vadim. vkassin@mail.ru

ps. sorry of my english.

This should be fixed now, also new server url obf.symbianos.org/osmgetbmap.php --Adamboardman 23:27, 18 October 2008 (UTC)

Lon/Lat representation

I would prefer to use the whole range of the 32bit integer to store lat/lon. It would be some kind of binary coded angle -> (0xffffffff + 1) = 360deg. The multiplication factor is as good as the current one because 10000 also gives no speed improvement and you get the advantage that invalid angles are impossible. In my opinion it makes no sense to use floating point values for storing angles, you just loose precision the bigger the angle gets. Also you never need nanometer precision at zero degrees...

That would be a different format, this format wishes to maintain forwards and backwards compatibility as much as possible. The * 1000000 was chosen as its considered to be sufficiently accurate for the purpose at hand and because its human readable without the use of a calculator for debugging purposes. Elements of the main OSM database and newer binary forms tend to use your suggested method, had they happened first or someone suggested it before initial deployment... --Adamboardman 15:06, 9 January 2009 (UTC)

software using this format

I would like to add a section "usage" to this page. Does anyone have an overview of the programs that support this protocol as a client? --MarcusWolschon 12:00, 6 January 2009 (UTC)

Personal tools
Namespaces
Variants
Actions
site
Toolbox