com.vividsolutions.jcs.conflate.polygonmatch
Class TargetUnioningFCMatchFinder

java.lang.Object
  extended bycom.vividsolutions.jcs.conflate.polygonmatch.TargetUnioningFCMatchFinder
All Implemented Interfaces:
FCMatchFinder

public class TargetUnioningFCMatchFinder
extends java.lang.Object
implements FCMatchFinder

An FCMatchFinder wrapper that also treats unions of adjacent target features as themselves target features. Such unions are formed into composite target features. These composites are temporary -- before the results are returned, each composite is split into its constituent features.

The result returned is a one-to-one mapping of target feature to matched candidate feature; the one-to-one mapping is achieved by discarding all matches except for those with the highest scores, for each feature (target and matched candidate).

Note on composites: if a composite's top score is higher than the top score of each of its constituents, the composite match is retained and constituent matches are discarded; otherwise, the composite match is discarded and constituent matches are retained.


Nested Class Summary
static class TargetUnioningFCMatchFinder.CompositeFeature
           
 
Constructor Summary
TargetUnioningFCMatchFinder(int maxCompositeSize, FCMatchFinder matchFinder)
           
 
Method Summary
protected  com.vividsolutions.jump.feature.FeatureCollection createCompositeFC(com.vividsolutions.jump.feature.FeatureCollection fc, com.vividsolutions.jump.task.TaskMonitor monitor)
           
protected  java.util.Map disambiguateCompositeTargetConstituents(java.util.Map compositeTargetToMatchesMap, com.vividsolutions.jump.feature.FeatureSchema candidateSchema, com.vividsolutions.jump.task.TaskMonitor monitor)
          Returns a composite-target-to-Matches map in which each target constituent will be found in at most one composite target.
 java.lang.Integer getUnionID(com.vividsolutions.jump.feature.Feature target)
           
 java.util.Map match(com.vividsolutions.jump.feature.FeatureCollection targetFC, com.vividsolutions.jump.feature.FeatureCollection candidateFC, com.vividsolutions.jump.task.TaskMonitor monitor)
          For each target feature, finds matches among the candidate features.
protected  boolean shareEdge(com.vividsolutions.jts.geom.Geometry a, com.vividsolutions.jts.geom.Geometry b)
           
protected  java.util.Map splitCompositeTargets(java.util.Map compositeToMatchesMap, com.vividsolutions.jump.task.TaskMonitor monitor)
          Splits each composite target into its constituent features.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargetUnioningFCMatchFinder

public TargetUnioningFCMatchFinder(int maxCompositeSize,
                                   FCMatchFinder matchFinder)
Parameters:
maxCompositeSize - the maximum number of adjacent target features to try combining
matchFinder - the FCMatchFinder to wrap
Method Detail

match

public java.util.Map match(com.vividsolutions.jump.feature.FeatureCollection targetFC,
                           com.vividsolutions.jump.feature.FeatureCollection candidateFC,
                           com.vividsolutions.jump.task.TaskMonitor monitor)
Description copied from interface: FCMatchFinder
For each target feature, finds matches among the candidate features.

Specified by:
match in interface FCMatchFinder
Returns:
a map of target-feature to matching-features (a Matches object)

createCompositeFC

protected com.vividsolutions.jump.feature.FeatureCollection createCompositeFC(com.vividsolutions.jump.feature.FeatureCollection fc,
                                                                              com.vividsolutions.jump.task.TaskMonitor monitor)

disambiguateCompositeTargetConstituents

protected java.util.Map disambiguateCompositeTargetConstituents(java.util.Map compositeTargetToMatchesMap,
                                                                com.vividsolutions.jump.feature.FeatureSchema candidateSchema,
                                                                com.vividsolutions.jump.task.TaskMonitor monitor)
Returns a composite-target-to-Matches map in which each target constituent will be found in at most one composite target. Does not disambiguate composite targets or matches (use DisambiguatingFCMatchFinder to do that), just composite target constituents.


shareEdge

protected boolean shareEdge(com.vividsolutions.jts.geom.Geometry a,
                            com.vividsolutions.jts.geom.Geometry b)

splitCompositeTargets

protected java.util.Map splitCompositeTargets(java.util.Map compositeToMatchesMap,
                                              com.vividsolutions.jump.task.TaskMonitor monitor)
Splits each composite target into its constituent features.


getUnionID

public java.lang.Integer getUnionID(com.vividsolutions.jump.feature.Feature target)