org.openstreetmap.osmosis.core.container.v0_6
Interface DatasetContext

All Superinterfaces:
Completable, Releasable
All Known Implementing Classes:
DatasetStoreReader, PostgreSqlDatasetContext

public interface DatasetContext
extends Completable

Provides access to data within a Dataset. Every thread must access a Dataset through its own reader. A reader must be released after use. It must be completed in order to ensure changes are committed.

Author:
Brett Henderson

Method Summary
 Node getNode(long id)
          Deprecated. The node manager should be used instead.
 EntityManager<Node> getNodeManager()
          Returns the manager for manipulating node instances.
 Relation getRelation(long id)
          Deprecated. The node manager should be used instead.
 EntityManager<Relation> getRelationManager()
          Returns the manager for manipulating relation instances.
 Way getWay(long id)
          Deprecated. The node manager should be used instead.
 EntityManager<Way> getWayManager()
          Returns the manager for manipulating way instances.
 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.Completable
complete
 
Methods inherited from interface org.openstreetmap.osmosis.core.lifecycle.Releasable
release
 

Method Detail

getNodeManager

EntityManager<Node> getNodeManager()
Returns the manager for manipulating node instances.

Returns:
The node manager.

getWayManager

EntityManager<Way> getWayManager()
Returns the manager for manipulating way instances.

Returns:
The way manager.

getRelationManager

EntityManager<Relation> getRelationManager()
Returns the manager for manipulating relation instances.

Returns:
The relation manager.

getNode

@Deprecated
Node getNode(long id)
Deprecated. The node manager should be used instead.

Retrieves a specific node by its identifier.

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

getWay

@Deprecated
Way getWay(long id)
Deprecated. The node manager should be used instead.

Retrieves a specific way by its identifier.

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

getRelation

@Deprecated
Relation getRelation(long id)
Deprecated. The node manager should be used instead.

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.