Class LineStringExtracter

java.lang.Object
org.locationtech.jts.geom.util.LineStringExtracter
All Implemented Interfaces:
GeometryFilter

public class LineStringExtracter extends Object implements GeometryFilter
Extracts all the LineString elements from a Geometry.
Version:
1.7
See Also:
  • Constructor Details

    • LineStringExtracter

      public LineStringExtracter(List comps)
      Constructs a filter with a list in which to store the elements found.
  • Method Details

    • getLines

      public static List getLines(Geometry geom, List lines)
      Extracts the LineString elements from a single Geometry and adds them to the provided List.
      Parameters:
      geom - the geometry from which to extract
      lines - the list to add the extracted LineStrings to
      Returns:
      the list argument
    • getLines

      public static List getLines(Geometry geom)
      Extracts the LineString elements from a single Geometry and returns them in a List.
      Parameters:
      geom - the geometry from which to extract
      Returns:
      a list containing the linear elements
    • getGeometry

      public static Geometry getGeometry(Geometry geom)
      Extracts the LineString elements from a single Geometry and returns them as either a LineString or MultiLineString.
      Parameters:
      geom - the geometry from which to extract
      Returns:
      a linear geometry
    • filter

      public void filter(Geometry geom)
      Description copied from interface: GeometryFilter
      Performs an operation with or on geom.
      Specified by:
      filter in interface GeometryFilter
      Parameters:
      geom - a Geometry to which the filter is applied.