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

📄 getwptzhuanghao.java

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

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;
import net.aetherial.gis.cutAndLink.cut.CutToSection;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class getWptZhuanghao {
  private Node waypoint = null;
  private Node track = null;

  public getWptZhuanghao() {
  }

  public void setWaypoint(Node waypoint) {
    this.waypoint = waypoint;
  }

  public void setTrack(Node track) {
    this.track = track;
  }


  public double getWaypointDis(){
    Node first = this.createFirstWaypoint();
    if (first == null || this.waypoint == null || this.track == null) {
      return 0;
    }else{
      Node newTrk = this.getCutTrack(first,this.waypoint);
      if (newTrk == null) {
        ItemValue.removeWaypoint(first);
        return 0;
      }else{
        double dis = ItemValue.getTracksDistance(newTrk);
        ItemValue.removeTrack(newTrk);
        ItemValue.removeWaypoint(first);
        return dis;
      }
    }
  }

  public String getWaypointZhuanghao(){
    double dis = this.getWaypointDis();
    java.text.DecimalFormat format = new java.text.DecimalFormat("#.###");
    return format.format(dis/1000);
  }

  private Node createFirstWaypoint() {
    NodeList nl = ItemValue.getTracksPoint(this.track);
    if (nl != null) {
      return ItemValue.turnTracksPointToWaypoint(nl.item(0));
    }
    else {
      return null;
    }
  }

  private Node getCutTrack(Node start, Node end) {
    CutToSection cut = new CutToSection();

    cut.setStartEnd(start, end); //?
    cut.setTrack(track);

    return cut.createNewDocNode();
  }

}

⌨️ 快捷键说明

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