Package com.vividsolutions.jump.feature

Examples of com.vividsolutions.jump.feature.Feature


*/
public static void print(FeatureCollection fc)
  {
    List featList = fc.getFeatures();
    for (Iterator i = featList.iterator(); i.hasNext(); ) {
      Feature f = (Feature) i.next();
      System.out.println(f.getGeometry());
    }
  }
View Full Code Here


  }

  private Matches toMatches(Map featureToScoreMap, FeatureSchema schema) {
    Matches matches = new Matches(schema);
    for (Iterator i = featureToScoreMap.keySet().iterator(); i.hasNext(); ) {
      Feature feature = (Feature) i.next();
      double score = ((Double) featureToScoreMap.get(feature)).doubleValue();
      matches.add(feature, score);
    }
    return matches;
  }
View Full Code Here

    public static SortedSet createDisambiguationMatches(Map targetToMatchesMap, TaskMonitor monitor) {
        TreeSet set = new TreeSet();
        monitor.report("Sorting scores");
        int k = 0;
        for (Iterator i = targetToMatchesMap.keySet().iterator(); i.hasNext();) {
            Feature target = (Feature) i.next();
            Matches matches = (Matches) targetToMatchesMap.get(target);
            monitor.report(++k, targetToMatchesMap.keySet().size(), "features");
            for (int j = 0; j < matches.size(); j++) {
                set.add(new DisambiguationMatch(target, matches.getFeature(j), matches.getScore(j)));
            }
View Full Code Here

   * preserved from the original Matches object.
   */
    @Override
  public Matches match(Feature target, FeatureCollection candidates) {
    Matches survivors = new Matches(candidates.getFeatureSchema());
    Feature survivor = null;
    double topScore = 0;
    Matches matches = (Matches) candidates;
    for (int i = 0; i < matches.size(); i++) {
      if (matches.getScore(i) >= topScore) {
        topScore = matches.getScore(i);
View Full Code Here

   * preserved from the original Matches object.
   */
    @Override
  public Matches match(Feature target, FeatureCollection candidates) {
    Matches survivors = new Matches(candidates.getFeatureSchema());
    Feature survivor = null;
    double topScore = 0;
    Matches matches = (Matches) candidates;
    for (int i = 0; i < matches.size(); i++) {
      if (matches.getScore(i) >= topScore) {
        topScore = matches.getScore(i);
View Full Code Here

   * @return a map of target-feature to matching-features (a Matches object)
   */
  public Map match(FeatureCollection targetFC, FeatureCollection candidateFC) {
    TreeMap map = new TreeMap();
    for (Iterator i = targetFC.iterator(); i.hasNext(); ) {
      Feature subjectFeature = (Feature) i.next();
      map.put(subjectFeature, matcher.match(subjectFeature, candidateFC));
    }
    return map;
  }
View Full Code Here

        int totalFeatures = featureToMatchesMap1.size();
        Map commonMatches = new HashMap();
        for (Iterator i = featureToMatchesMap1.keySet().iterator();
            i.hasNext() && !monitor.isCancelRequested();
            ) {
            Feature key1 = (Feature) i.next();
            featuresProcessed++;
            monitor.report(featuresProcessed, totalFeatures, "features");
            if (!featureToMatchesMap2.containsKey(key1)) {
                continue;
            }
View Full Code Here

            return newMap;
        }
        for (Iterator i = featureToMatchesMap.keySet().iterator();
            i.hasNext() && !monitor.isCancelRequested();
            ) {
            Feature feature = (Feature) i.next();
            featuresProcessed++;
            monitor.report(featuresProcessed, totalFeatures, "features filtered");
            Matches oldMatches = (Matches) featureToMatchesMap.get(feature);
            if (oldMatches.isEmpty()) {
                continue;
View Full Code Here

            return newMap;
        }
        for (Iterator i = featureToMatchesMap.keySet().iterator();
            i.hasNext() && !monitor.isCancelRequested();
            ) {
            Feature oldKey = (Feature) i.next();
            featuresProcessed++;
            monitor.report(featuresProcessed, totalFeatures, "features inverted");
            Matches oldMatches = (Matches) featureToMatchesMap.get(oldKey);
            for (int j = 0; j < oldMatches.size(); j++) {
                Feature newKey = oldMatches.getFeature(j);
                Matches newMatches = (Matches) newMap.get(newKey);
                if (newMatches == null) {
                    newMatches = new Matches(oldKey.getSchema());
                }
                newMatches.add(oldKey, oldMatches.getScore(j));
View Full Code Here

  private Map commonMatches(Map featureToMatchesMap1, Map featureToMatchesMap2, TaskMonitor monitor) {
    int featuresProcessed = 0;
    int totalFeatures = featureToMatchesMap1.size();
    Map commonMatches = new HashMap();
    for (Iterator i = featureToMatchesMap1.keySet().iterator(); i.hasNext() && ! monitor.isCancelRequested(); ) {
      Feature key1 = (Feature) i.next();
      featuresProcessed++;
      monitor.report(featuresProcessed, totalFeatures, "features");
      if (! featureToMatchesMap2.containsKey(key1)) { continue; }
      Matches matches1 = (Matches) featureToMatchesMap1.get(key1);
      Matches matches2 = (Matches) featureToMatchesMap2.get(key1);
View Full Code Here

TOP

Related Classes of com.vividsolutions.jump.feature.Feature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.