[josm-dev] code re-use for mobile OSM?
Petr Nejedly
Petr.Nejedly at Sun.COM
Sun Mar 9 19:04:40 GMT 2008
S.B.Hawkins napsal(a):
> hi there,
>
> i'm new to the mailing list but i'm currently working on a final year
> university project involving OSM. The basis of it is getting the map displayed
> on a mobile device.
I wish you good luck then, being happy there's another thing that somebody
does for me so I don't need to do it myself ;-)
> I was hoping it would be possible to make use of some of the code involved in
> JOSM? Obviously it would be made clear this was not my own intellectual
> property in the project itself, would this be possible??
License-wise, you're welcome as long as you keep your project GPLv2 then.
Code wise, I'm not sure you'd be able to reuse much.
I expect the target platform is J2ME, right. Do you expect to store (or at
least cache) maps locally?
In any case, you should look at the OSM mobile API [1] (a binary protocol
optimized for mobile usages where bandwidth is scarce and transfered data
are far from free).
> Also, i've been to
> http://josm.openstreetmap.de/svn/trunk/src/org/openstreetmap/josm/
> but i'm a little unsure of where to look for what i'm after making use of.
> I was hoping to make use of JOSM's ability to read the OSM files and inform
> myself of how to then work with those results. Could someone point me in the
> right direction??
See the OSM protocol [2] itself and make yourself familiar with OSM primitives first.
The next paragraph expects you know how are the geodata represented in OSM world.
Because the device resources are quite limited too, you'll need to
pay special attention to data structure design that would cover use cases
as effectively as possible. If map editing is not such an use case*, your
data structures would end up very different from what JOSM uses as you'd optimize
for rendering and routing.
Forget about Node class. Maybe forget even about Way class. Class instances
are too bulky for J2ME space, as any J2ME game developer would tell you.
Byte/int array be your friend ;-)
Forget about keeping tags in their string forms, forget about keeping most
of them, anyway.
*) Even if editing was an use case, I'd go with read-only optimized layer
and an (initially empty) overlay with all the OSM bells and whistles.
The user won't be able to author too much of the data on the road anyway.
[1] http://wiki.openstreetmap.org/index.php/OSM_Mobile_Binary_Protocol
[2] http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.5
--
Petr "Nenik" Nejedly, NetBeans/Sun Microsystems, http://www.netbeans.org
355/113 -- Not the famous irrational number PI, but an incredible simulation!
More information about the josm-dev
mailing list