org.openstreetmap.osmosis.core.container.v0_5
Interface DatasetReader

All Superinterfaces:
Releasable
All Known Implementing Classes:
BaseDatasetReader, DatasetStoreReader, PostgreSqlDatasetReader

public interface DatasetReader
extends Releasable

Provides access to data within a Dataset. Every thread must access a Dataset through its own reader. A reader must be released after use.

Author:
Brett Henderson

Method Summary
 Node getNode(long id)
          Retrieves a specific node by its identifier.
 Relation getRelation(long id)
          Retrieves a specific relation by its identifier.
 Way getWay(long id)
          Retrieves a specific way by its identifier.
 ReleasableIterator<EntityContainer> iterate()
          Allows the entire dataset to be iterated across.
 ReleasableIterator<EntityContainer> iterateBoundingBox(double left, double right, double top, double bottom, boolean completeWays)
          Allows all data within a bounding box to be iterated across.
 
Methods inherited from interface org.openstreetmap.osmosis.core.lifecycle.Releasable
release
 

Method Detail

getNode

Node getNode(long id)
Retrieves a specific node by its identifier.

Parameters:
id - The id of the node.
Returns:
The node.

getWay

Way getWay(long id)
Retrieves a specific way by its identifier.

Parameters:
id - The id of the way.
Returns:
The way.

getRelation

Relation getRelation(long id)
Retrieves a specific relation by its identifier.

Parameters:
id - The id of the relation.
Returns:
The relation.

iterate

ReleasableIterator<EntityContainer> iterate()
Allows the entire dataset to be iterated across.

Returns:
An iterator pointing to the start of the collection.

iterateBoundingBox

ReleasableIterator<EntityContainer> iterateBoundingBox(double left,
                                                       double right,
                                                       double top,
                                                       double bottom,
                                                       boolean completeWays)
Allows all data within a bounding box to be iterated across.

Parameters:
left - The longitude marking the left edge of the bounding box.
right - The longitude marking the right edge of the bounding box.
top - The latitude marking the top edge of the bounding box.
bottom - The latitude marking the bottom edge of the bounding box.
completeWays - If true, all nodes within the ways will be returned even if they lie outside the box.
Returns:
An iterator pointing to the start of the result data.