Class LinearComponentExtracter

Hierarchy: Object , LinearComponentExtracter
All Implemented Interfaces: GeometryComponentFilter
public class LinearComponentExtracter
implements GeometryComponentFilter
Extracts all the 1-dimensional ( LineString) components from a Geometry. For polygonal geometries, this will extract all the component LinearRings. If desired, LinearRings can be forced to be returned as LineStrings.

Other

  • version: 1.7
public LinearComponentExtracter(Collection lines)
Constructs a LineExtracterFilter with a list in which to store LineStrings found.
public LinearComponentExtracter(Collection lines, boolean isForcedToLineString)
Constructs a LineExtracterFilter with a list in which to store LineStrings found.
public static Collection getLines(Collection geoms, Collection lines)
Extracts the linear components from a single Geometry and adds them to the provided Collection.
Parameters:
geoms - geoms the collection of geometries from which to extract linear components
lines - lines the collection to add the extracted linear components to
Returns:
the collection of linear components (LineStrings or LinearRings)
public static Collection getLines(Collection geoms, Collection lines, boolean forceToLineString)
Extracts the linear components from a single Geometry and adds them to the provided Collection.
Parameters:
geoms - geoms the Collection of geometries from which to extract linear components
lines - lines the collection to add the extracted linear components to
forceToLineString - forceToLineString true if LinearRings should be converted to LineStrings
Returns:
the collection of linear components (LineStrings or LinearRings)
public static Collection getLines(Geometry geom, Collection lines)
Extracts the linear components from a single Geometry and adds them to the provided Collection.
Parameters:
geom - geom the geometry from which to extract linear components
lines - lines the Collection to add the extracted linear components to
Returns:
the Collection of linear components (LineStrings or LinearRings)
public static Collection getLines(Geometry geom, Collection lines, boolean forceToLineString)
Extracts the linear components from a single Geometry and adds them to the provided Collection.
Parameters:
geom - geom the geometry from which to extract linear components
lines - lines the Collection to add the extracted linear components to
forceToLineString - forceToLineString true if LinearRings should be converted to LineStrings
Returns:
the Collection of linear components (LineStrings or LinearRings)
public static List getLines(Geometry geom)
Extracts the linear components from a single geometry. If more than one geometry is to be processed, it is more efficient to create a single LinearComponentExtracter instance and pass it to multiple geometries.
Parameters:
geom - geom the geometry from which to extract linear components
Returns:
the list of linear components
public static List getLines(Geometry geom, boolean forceToLineString)
Extracts the linear components from a single geometry. If more than one geometry is to be processed, it is more efficient to create a single LinearComponentExtracter instance and pass it to multiple geometries.
Parameters:
geom - geom the geometry from which to extract linear components
forceToLineString - forceToLineString true if LinearRings should be converted to LineStrings
Returns:
the list of linear components
public static Geometry getGeometry(Geometry geom)
Extracts the linear components from a single Geometry and returns them as either a LineString or MultiLineString.
Parameters:
geom - geom the geometry from which to extract
Returns:
a linear geometry
public static Geometry getGeometry(Geometry geom, boolean forceToLineString)
Extracts the linear components from a single Geometry and returns them as either a LineString or MultiLineString.
Parameters:
geom - geom the geometry from which to extract
forceToLineString - forceToLineString true if LinearRings should be converted to LineStrings
Returns:
a linear geometry
public void setForceToLineString(boolean isForcedToLineString)
Indicates that LinearRing components should be converted to pure LineStrings.
Parameters:
isForcedToLineString - isForcedToLineString true if LinearRings should be converted to LineStrings
public void filter(Geometry geom)