⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 concatenatedtrackdecussate.java

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JAVA
字号:
package net.aetherial.gis.publicuse.track;

import net.aetherial.gis.surface.ItemValue;
import org.w3c.dom.Node;
import java.util.Vector;
import net.aetherial.gis.publicuse.TrackOper;
import net.aetherial.gis.our.auto.check.repeattrk.TrackRectangle;
import org.w3c.dom.NodeList;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */

public class ConcatenatedTrackDecussate
    extends TrackDecussate {
  private ConcatenatedTrack trk1 = null, trk2 = null;
  public ConcatenatedTrackDecussate() {

  }

  /**
   * 给定航迹1
   */
  public void setTrack1(ConcatenatedTrack trk) {
    this.trk1 = trk;
  }

  /**
   * 给定航迹2
   */
  public void setTrack2(ConcatenatedTrack trk) {
    this.trk2 = trk;
  }

  /**
   * 给定两条相互比较的航迹
   */
  public void setTracks(ConcatenatedTrack trk1, ConcatenatedTrack trk2) {
    this.trk1 = trk1;
    this.trk2 = trk2;
  }

  /**
   * 判断航迹是否交叉
   */
  public boolean isDecussate() {
    if ( (this.trk1 == null) || (this.trk1 == null)) {
      return false;
    }
    Vector nl1 = this.trk1.getTrackPoints();
    Vector nl2 = this.trk2.getTrackPoints();
    if ( (nl1 == null) || (nl2 == null)) {
      return false;
    }
    else {
      for (int i = 0; i < nl1.size(); i++) {
        if (i >= nl1.size() - 1) {
          break;
        }
        for (int j = 0; j < nl2.size(); j++) {
          if (j >= nl2.size() - 1) {
            break;
          }
          if (isTrackPointDecussate( (Node) nl1.get(i), (Node) nl1.get(i + 1),
                                    (Node) nl2.get(j),
                                    (Node) nl2.get(j + 1))) {
            return true;
          }
        }
      }
    }
    return false;
  }

  /**
   * 判断两条航迹是否连接,这种连接包括T字型连接
   */
  public boolean isTLink() {
    Vector nl1 = this.trk1.getTrackPoints();
    Vector nl2 = this.trk1.getTrackPoints();
    if ( (nl1 == null) || (nl2 == null)) {
      return false;
    }
    Node t1p1 = (Node) nl1.get(0);
    Node t1p2 = (Node) nl1.get(nl1.size() - 1);
    Node t2p1 = (Node) nl2.get(0);
    Node t2p2 = (Node) nl2.get(nl2.size() - 1);
    double minDis = TrackOper.getDisOfTracksWithPointInMid(Double.parseDouble(
        ItemValue.getTracksPointX(t1p1)),
        Double.parseDouble(ItemValue.getTracksPointY(t1p1)), this.trk2);
    minDis = Math.min(minDis,
                      TrackOper.getDisOfTracksWithPointInMid(Double.
        parseDouble(ItemValue.getTracksPointX(t1p2)),
        Double.parseDouble(ItemValue.getTracksPointY(t1p2)),
        this.trk2));
    minDis = Math.min(minDis,
                      TrackOper.getDisOfTracksWithPointInMid(Double.
        parseDouble(ItemValue.getTracksPointX(t2p1)),
        Double.parseDouble(ItemValue.getTracksPointY(t2p1)),
        this.trk1));
    minDis = Math.min(minDis,
                      TrackOper.getDisOfTracksWithPointInMid(Double.
        parseDouble(ItemValue.getTracksPointX(t2p2)),
        Double.parseDouble(ItemValue.getTracksPointY(t2p2)),
        this.trk1));
    if (minDis < TrackRectangle.NEAR_DISTANCE * 5) {
      return true;
    }
    return false;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -