public class LinearComponentExtracter extends Object implements GeometryComponentFilter
LineString
) components from a Geometry
.
For polygonal geometries, this will extract all the component LinearRing
s.
If desired, LinearRing
s can be forced to be returned as LineString
s.Constructor and Description |
---|
LinearComponentExtracter(Collection lines)
Constructs a LineExtracterFilter with a list in which to store LineStrings found.
|
LinearComponentExtracter(Collection lines,
boolean isForcedToLineString)
Constructs a LineExtracterFilter with a list in which to store LineStrings found.
|
Modifier and Type | Method and Description |
---|---|
void |
filter(Geometry geom)
Performs an operation with or on
geom . |
static Geometry |
getGeometry(Geometry geom)
Extracts the linear components from a single
Geometry
and returns them as either a LineString or MultiLineString . |
static Geometry |
getGeometry(Geometry geom,
boolean forceToLineString)
Extracts the linear components from a single
Geometry
and returns them as either a LineString or MultiLineString . |
static Collection |
getLines(Collection geoms,
Collection lines)
Extracts the linear components from a single
Geometry
and adds them to the provided Collection . |
static Collection |
getLines(Collection geoms,
Collection lines,
boolean forceToLineString)
Extracts the linear components from a single
Geometry
and adds them to the provided Collection . |
static List |
getLines(Geometry geom)
Extracts the linear components from a single geometry.
|
static List |
getLines(Geometry geom,
boolean forceToLineString)
Extracts the linear components from a single geometry.
|
static Collection |
getLines(Geometry geom,
Collection lines)
Extracts the linear components from a single
Geometry
and adds them to the provided Collection . |
static Collection |
getLines(Geometry geom,
Collection lines,
boolean forceToLineString)
Extracts the linear components from a single
Geometry
and adds them to the provided Collection . |
void |
setForceToLineString(boolean isForcedToLineString)
Indicates that LinearRing components should be
converted to pure LineStrings.
|
public LinearComponentExtracter(Collection lines)
public LinearComponentExtracter(Collection lines, boolean isForcedToLineString)
public static Collection getLines(Collection geoms, Collection lines)
Geometry
and adds them to the provided Collection
.geoms
- the collection of geometries from which to extract linear componentslines
- the collection to add the extracted linear components topublic static Collection getLines(Collection geoms, Collection lines, boolean forceToLineString)
Geometry
and adds them to the provided Collection
.geoms
- the Collection of geometries from which to extract linear componentslines
- the collection to add the extracted linear components toforceToLineString
- true if LinearRings should be converted to LineStringspublic static Collection getLines(Geometry geom, Collection lines)
Geometry
and adds them to the provided Collection
.geom
- the geometry from which to extract linear componentslines
- the Collection to add the extracted linear components topublic static Collection getLines(Geometry geom, Collection lines, boolean forceToLineString)
Geometry
and adds them to the provided Collection
.geom
- the geometry from which to extract linear componentslines
- the Collection to add the extracted linear components toforceToLineString
- true if LinearRings should be converted to LineStringspublic static List getLines(Geometry geom)
LinearComponentExtracter
instance
and pass it to multiple geometries.geom
- the geometry from which to extract linear componentspublic static List getLines(Geometry geom, boolean forceToLineString)
LinearComponentExtracter
instance
and pass it to multiple geometries.geom
- the geometry from which to extract linear componentsforceToLineString
- true if LinearRings should be converted to LineStringspublic static Geometry getGeometry(Geometry geom)
Geometry
and returns them as either a LineString
or MultiLineString
.geom
- the geometry from which to extractpublic static Geometry getGeometry(Geometry geom, boolean forceToLineString)
Geometry
and returns them as either a LineString
or MultiLineString
.geom
- the geometry from which to extractforceToLineString
- true if LinearRings should be converted to LineStringspublic void setForceToLineString(boolean isForcedToLineString)
isForcedToLineString
- true if LinearRings should be converted to LineStringspublic void filter(Geometry geom)
GeometryComponentFilter
geom
.filter
in interface GeometryComponentFilter
geom
- a Geometry
to which the filter is applied.Copyright © 2022. All rights reserved.