Statistics
| Revision:

root / trunk / libraries / libTopology / src / com / vividsolutions / jcs / conflate / polygonmatch / OverlapMatcher.java @ 22873

History | View | Annotate | Download (520 Bytes)

1
package com.vividsolutions.jcs.conflate.polygonmatch;
2

    
3
import com.vividsolutions.jts.geom.Geometry;
4

    
5
public class OverlapMatcher extends IndependentCandidateMatcher {
6

    
7
    public double match(Geometry target, Geometry candidate) {
8
        //Impose the min to curb roundoff error in exact matches (a situation which
9
        //arose during testing (identical datasets)) [Jon Aquino]
10
        return Math.min(1, (2 * target.intersection(candidate).getArea())
11
            / (target.getArea() + candidate.getArea()));
12
    }
13
}