Package org.locationtech.jts.coverage
Class CoverageGapFinder
- java.lang.Object
-
- org.locationtech.jts.coverage.CoverageGapFinder
-
public class CoverageGapFinder extends Object
Finds gaps in a polygonal coverage. Gaps are holes in the coverage which are narrower than a given width.The coverage should be valid according to
CoverageValidator
. If this is not the case, some gaps may not be reported, or the invocation may fail.This is a more accurate way of identifying gaps than using
CoverageValidator.setGapWidth(double)
. Gaps which separate the coverage into two disjoint regions are not detected. Gores are not identified as gaps.- Author:
- mdavis
-
-
Constructor Summary
Constructors Constructor Description CoverageGapFinder(Geometry[] coverage)
Creates a new polygonal coverage gap finder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Geometry
findGaps(double gapWidth)
Finds gaps in the coverage.static Geometry
findGaps(Geometry[] coverage, double gapWidth)
Finds gaps in a polygonal coverage.
-
-
-
Constructor Detail
-
CoverageGapFinder
public CoverageGapFinder(Geometry[] coverage)
Creates a new polygonal coverage gap finder.- Parameters:
coverage
- a set of polygons forming a polygonal coverage
-
-
Method Detail
-
findGaps
public static Geometry findGaps(Geometry[] coverage, double gapWidth)
Finds gaps in a polygonal coverage. Returns lines indicating the locations of the gaps.- Parameters:
coverage
- a set of polygons forming a polygonal coveragegapWidth
- the maximum width of gap to detect- Returns:
- a geometry indicating the locations of gaps (which is empty if no gaps were found), or null if the coverage was empty
-
findGaps
public Geometry findGaps(double gapWidth)
Finds gaps in the coverage. Returns lines indicating the locations of the gaps.- Parameters:
gapWidth
- the maximum width of gap to detect- Returns:
- a geometry indicating the locations of gaps (which is empty if no gaps were found), or null if the coverage was empty
-
-