[OSM-dev] New OSM binary fileformat implementation.

Marcus Wolschon marcus.wolschon at googlemail.com
Fri May 7 09:01:24 BST 2010

On Thu, May 6, 2010 at 6:13 PM, Nolan Darilek <nolan at thewordnerd.info> wrote:

> Sure. You can see the interface I've implemented here:
> http://travelingsales.svn.sourceforge.net/viewvc/travelingsales/trunk/libosm/src/org/openstreetmap/osm/data/IDataSet.java?view=markup
> Basically, the executive summary is that there are four broad kinds of
> lookups:
> Entity by ID, as mentioned earlier
> Entities based on intersection with bounding box, currently done by the
> somewhat inaccurate method of finding all contained nodes, then
> returning any associated ways/relations. Would be great if I could
> locate contained ways even if they don't have a node in the box, but
> even if not, it'd be no worse than what's there now. :)
> Entities by presence of certain tags, in some instances also with
> bounding box conditions (I.e. all "amenity"->"fuel" nodes, or all of
> such nodes within a given bounds)
> Nearest entity to a given point, expanding outward. I can, for instance,
> roughly find the nearest way by finding the node nearest to a set of
> coordinates, checking for its presence in any ways, then finding the
> next nearest and recursing outward until the conditions are met. The
> conditions check is done externally, so the search need only return the
> nearest entity, next nearest, etc.)
> I know you've said elsewhere that you don't want this format to replace
> the need for a database, and I respect that. I just don't quite know
> where that line is. Even so, I clearly don't need all of my database's
> functionality for the OSM-facing aspects of this app and hope that these
> limited uses are in scope.
> Thanks for thinking about and working on these issues. :)

The most actively used ones are:

routing: access by ID and by reverse-lookup
* getNodeByID
* getWayByID
* getWaysForNode(nodeID)
* getRelationsForWay(wayID)
* getRelationsForNode(nodeID)

rendering: access by bounding-box
* getNodes(Bounds)
* getWays(Bounds)
(for zoom-levels where you render all of a city/state/country/continent
 separate, simplified map-datasets are used both in terms of the number of
 elements contained as well as their complexity.)


More information about the dev mailing list