com.vividsolutions.jts.geom.util

Class PolygonExtracter

Implemented Interfaces:
GeometryFilter

public class PolygonExtracter
extends java.lang.Object
implements GeometryFilter

Extracts all the 2-dimensional (Polygon) components from a Geometry.
Version:
1.6

Constructor Summary

PolygonExtracter(List comps)
Constructs a PolygonExtracterFilter with a list in which to store Polygons found.

Method Summary

void
filter(Geometry geom)
static List
getPolygons(Geometry geom)
Returns the Polygon components from a single geometry.

Constructor Details

PolygonExtracter

public PolygonExtracter(List comps)
Constructs a PolygonExtracterFilter with a list in which to store Polygons found.

Method Details

filter

public void filter(Geometry geom)
Specified by:
filter in interface GeometryFilter

getPolygons

public static List getPolygons(Geometry geom)
Returns the Polygon components from a single geometry. If more than one geometry is to be processed, it is more efficient to create a single PolygonExtracterFilter instance and pass it to multiple geometries.