Package adams.data.objectfilter
Class MergeOverlapsHelper
- java.lang.Object
-
- adams.data.objectfilter.MergeOverlapsHelper
-
public class MergeOverlapsHelper extends Object
Helper class for merging object overlaps.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description MergeOverlapsHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<LocatedObject>
findObjectsToMerge(LocatedObject obj, Map<LocatedObject,Double> matches, Set<LocatedObject> merged, String labelKey)
Determines the objects to merge.static List<LocatedObject>
mergeObjects(LoggingObject loggingObject, List<LocatedObject> objs, ObjectOverlap algorithm, String scoreKey, String labelKey, MergedScoreCalculation mergedScoreCalculation)
Merges the objects into a single on.static org.locationtech.jts.geom.Geometry
toGeometry(LocatedObject obj, ObjectOverlap algorithm)
Turns the located object's polygon or bbox into a Geometry instance.
-
-
-
Method Detail
-
findObjectsToMerge
public static List<LocatedObject> findObjectsToMerge(LocatedObject obj, Map<LocatedObject,Double> matches, Set<LocatedObject> merged, String labelKey)
Determines the objects to merge.- Parameters:
obj
- the objects for which matches were locatedmatches
- the matching objectsmerged
- the objects that have been merged alreadylabelKey
- the key in the metadata containing the label- Returns:
- the list of objects to merge
-
toGeometry
public static org.locationtech.jts.geom.Geometry toGeometry(LocatedObject obj, ObjectOverlap algorithm)
Turns the located object's polygon or bbox into a Geometry instance. Takes potential bbox fallback into account.- Parameters:
obj
- the object to convertalgorithm
- the overlap algorithm to use- Returns:
- the generated Gemoetry
-
mergeObjects
public static List<LocatedObject> mergeObjects(LoggingObject loggingObject, List<LocatedObject> objs, ObjectOverlap algorithm, String scoreKey, String labelKey, MergedScoreCalculation mergedScoreCalculation)
Merges the objects into a single on.- Parameters:
loggingObject
- the project use for logging errors etc, can be nullobjs
- the objects to mergealgorithm
- the overlap algorithm to usescoreKey
- the meta-data key with the scorelabelKey
- the meta-data key with the labelmergedScoreCalculation
- how to calculate the merged score- Returns:
- the merged object
-
-