org.openstreetmap.osmosis.core.filter.v0_5.impl
Class BaseDatasetReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.filter.v0_5.impl.BaseDatasetReader
All Implemented Interfaces:
DatasetReader, Releasable
Direct Known Subclasses:
DatasetStoreReader

public abstract class BaseDatasetReader
extends java.lang.Object
implements DatasetReader

Provides common behaviour between dataset reader implementations.

Author:
Brett Henderson

Constructor Summary
BaseDatasetReader()
           
 
Method Summary
protected abstract  ReleasableIterator<java.lang.Long> getNodeIdsForTileRange(int minimumTile, int maximumTile)
          Returns all nodes that are contained within the specified tile range.
protected abstract  ReleasableIterator<java.lang.Long> getRelationIdsOwningNode(long nodeId)
          Returns all relations that contain the specified node.
protected abstract  ReleasableIterator<java.lang.Long> getRelationIdsOwningRelation(long relationId)
          Returns all relations that contain the specified relation.
protected abstract  ReleasableIterator<java.lang.Long> getRelationIdsOwningWay(long wayId)
          Returns all relations that contain the specified way.
protected abstract  ReleasableIterator<java.lang.Long> getWayIdsForTileRange(int minimumTile, int maximumTile)
          Returns all ways that are contained within the specified tile range.
protected abstract  ReleasableIterator<java.lang.Long> getWayIdsOwningNode(long nodeId)
          Returns all ways that contain the specified node.
protected abstract  boolean isTileWayIndexAvailable()
          Indicates if a tile index is available for ways or if a node to way index must be used instead.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.osmosis.core.container.v0_5.DatasetReader
getNode, getRelation, getWay, iterate
 
Methods inherited from interface org.openstreetmap.osmosis.core.lifecycle.Releasable
release
 

Constructor Detail

BaseDatasetReader

public BaseDatasetReader()
Method Detail

isTileWayIndexAvailable

protected abstract boolean isTileWayIndexAvailable()
Indicates if a tile index is available for ways or if a node to way index must be used instead.

Returns:
True if a tile index is available for ways.

getNodeIdsForTileRange

protected abstract ReleasableIterator<java.lang.Long> getNodeIdsForTileRange(int minimumTile,
                                                                             int maximumTile)
Returns all nodes that are contained within the specified tile range.

Parameters:
minimumTile - The minimum tile to match.
maximumTile - The maximum tile to match.
Returns:
The list of node ids.

getWayIdsForTileRange

protected abstract ReleasableIterator<java.lang.Long> getWayIdsForTileRange(int minimumTile,
                                                                            int maximumTile)
Returns all ways that are contained within the specified tile range.

Parameters:
minimumTile - The minimum tile to match.
maximumTile - The maximum tile to match.
Returns:
The list of way ids.

getWayIdsOwningNode

protected abstract ReleasableIterator<java.lang.Long> getWayIdsOwningNode(long nodeId)
Returns all ways that contain the specified node.

Parameters:
nodeId - The node for which to retrieve parent ways.
Returns:
The list of way ids.

getRelationIdsOwningNode

protected abstract ReleasableIterator<java.lang.Long> getRelationIdsOwningNode(long nodeId)
Returns all relations that contain the specified node.

Parameters:
nodeId - The node for which to retrieve parent relations.
Returns:
The list of relation ids.

getRelationIdsOwningWay

protected abstract ReleasableIterator<java.lang.Long> getRelationIdsOwningWay(long wayId)
Returns all relations that contain the specified way.

Parameters:
wayId - The way for which to retrieve parent relations.
Returns:
The list of relation ids.

getRelationIdsOwningRelation

protected abstract ReleasableIterator<java.lang.Long> getRelationIdsOwningRelation(long relationId)
Returns all relations that contain the specified relation.

Parameters:
relationId - The relation for which to retrieve parent relations.
Returns:
The list of relation ids.

iterateBoundingBox

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

Specified by:
iterateBoundingBox in interface DatasetReader
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.