source: osm/applications/editors/josm/plugins/conflation/src/com/vividsolutions/jcs/conflate/polygonmatch/IdenticalFeatureFilter.java@ 28163

Last change on this file since 28163 was 28163, checked in by joshdoe, 12 years ago

conflation: now uses Java Conflation Suite and depends on JTS plugin

Currently depends on a few JUMP classes and the JCS files are directly included, this will change in the future.

File size: 993 bytes
Line 
1package com.vividsolutions.jcs.conflate.polygonmatch;
2
3import com.vividsolutions.jump.feature.Feature;
4import com.vividsolutions.jump.feature.FeatureCollection;
5
6/**
7 * Filters out matches where features are identical.
8 */
9public class IdenticalFeatureFilter implements FeatureMatcher {
10
11 /**
12 * Filters out matches where features are identical.
13 * @param target the Feature which is the target
14 * @param candidates a Matches object created by another FeatureMatcher
15 * @return the candidates that aren't identical to the target
16 */
17 @Override
18 public Matches match(Feature target, FeatureCollection candidates) {
19 Matches survivors = new Matches(candidates.getFeatureSchema());
20 Matches allMatches = (Matches) candidates;
21 for (int i = 0; i < allMatches.size(); i++) {
22 if (!allMatches.getFeature(i).equals(target)) {
23 survivors.add(allMatches.getFeature(i), allMatches.getScore(i));
24 }
25 }
26 return survivors;
27 }
28}
Note: See TracBrowser for help on using the repository browser.