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

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

public class PolygonFilter
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
PolygonFilter(IdTrackerType idTrackerType, java.io.File polygonFile, boolean clipIncompleteEntities, boolean completeWays, boolean completeRelations)
          Creates a new instance.
 
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

PolygonFilter

public PolygonFilter(IdTrackerType idTrackerType,
                     java.io.File polygonFile,
                     boolean clipIncompleteEntities,
                     boolean completeWays,
                     boolean completeRelations)
Creates a new instance.

Parameters:
idTrackerType - Defines the id tracker implementation to use.
polygonFile - The file containing the polygon coordinates.
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.