Class Polygonizer



  • public class Polygonizer
    extends Object
    Polygonizes a set of Geometrys which contain linework that represents the edges of a planar graph. All types of Geometry are accepted as input; the constituent linework is extracted as the edges to be polygonized. The processed edges must be correctly noded; that is, they must only meet at their endpoints. The Polygonizer will run on incorrectly noded input but will not form polygons from non-noded edges, and will report them as errors.

    The Polygonizer reports the follow kinds of errors:

    • Dangles - edges which have one or both ends which are not incident on another edge endpoint
    • Cut Edges - edges which are connected at both ends but which do not form part of polygon
    • Invalid Ring Lines - edges which form rings which are invalid (e.g. the component lines contain a self-intersection)
    • Field Detail

      • graph

        protected com.vividsolutions.jts.operation.polygonize.PolygonizeGraph graph
      • cutEdges

        protected List cutEdges
      • invalidRingLines

        protected List invalidRingLines
      • holeList

        protected List holeList
      • shellList

        protected List shellList
      • polyList

        protected List polyList
    • Constructor Detail

    • Method Detail

      • add

        public void add(Collection geomList)
        Adds a collection of geometries to the edges to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used.
        Parameters:
        geomList - a list of Geometrys with linework to be polygonized
      • add

        public void add(Geometry g)
        Add a Geometry to the edges to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used
        Parameters:
        g - a Geometry with linework to be polygonized
      • getPolygons

        public Collection getPolygons()
        Gets the list of polygons formed by the polygonization.
        Returns:
        a collection of Polygons
      • getDangles

        public Collection getDangles()
        Gets the list of dangling lines found during polygonization.
        Returns:
        a collection of the input LineStrings which are dangles
      • getCutEdges

        public Collection getCutEdges()
        Gets the list of cut edges found during polygonization.
        Returns:
        a collection of the input LineStrings which are cut edges
      • getInvalidRingLines

        public Collection getInvalidRingLines()
        Gets the list of lines forming invalid rings found during polygonization.
        Returns:
        a collection of the input LineStrings which form invalid rings