org.openstreetmap.osmosis.core.filter.v0_6
Class BoundingBoxFilter

java.lang.Object
  extended by org.openstreetmap.osmosis.core.filter.v0_6.AreaFilter
      extended by org.openstreetmap.osmosis.core.filter.v0_6.BoundingBoxFilter
All Implemented Interfaces:
EntityProcessor, Completable, Releasable, Task, Sink, SinkSource, Source

public class BoundingBoxFilter
extends AreaFilter

Provides a filter for extracting all entities that lie within a specific geographical box identified by latitude and longitude coordinates.

Author:
Brett Henderson

Constructor Summary
BoundingBoxFilter(IdTrackerType idTrackerType, double left, double right, double top, double bottom, boolean clipIncompleteEntities, boolean completeWays, boolean completeRelations)
          Creates a new instance with the specified geographical coordinates.
 
Method Summary
protected  boolean isNodeWithinArea(Node node)
          Indicates if the node lies within the area required.
 void process(BoundContainer boundContainer)
          Process the bound.
 
Methods inherited from class org.openstreetmap.osmosis.core.filter.v0_6.AreaFilter
complete, process, process, process, process, release, setSink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundingBoxFilter

public BoundingBoxFilter(IdTrackerType idTrackerType,
                         double left,
                         double right,
                         double top,
                         double bottom,
                         boolean clipIncompleteEntities,
                         boolean completeWays,
                         boolean completeRelations)
Creates a new instance with the specified geographical coordinates. When filtering, nodes right on the edge of the box will be included.

Parameters:
idTrackerType - Defines the id tracker implementation to use.
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.
clipIncompleteEntities - If true, entities referring to non-existent entities will be modified to ensure referential integrity. For example, ways will be modified to only include nodes inside the area.
completeWays - Include all nodes for ways which have at least one node inside the filtered area.
completeRelations - Include all relations referenced by other relations which have members inside the filtered area.
Method Detail

process

public void process(BoundContainer boundContainer)
Process the bound.

Specified by:
process in interface EntityProcessor
Overrides:
process in class AreaFilter
Parameters:
boundContainer - The bound to be processed.

isNodeWithinArea

protected boolean isNodeWithinArea(Node node)
Indicates if the node lies within the area required.

Specified by:
isNodeWithinArea in class AreaFilter
Parameters:
node - The node to be checked.
Returns:
True if the node lies within the area.