📄 wptintrackzhuanghao.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;
/**
* <p>Title: </p>
*
* <p>Description: 航点在航迹中的桩号 </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class WptInTrackZhuanghao {
private Node waypoint = null;
private Node track = null;
public WptInTrackZhuanghao() {
}
public void setWaypoint(Node waypoint) {
this.waypoint = waypoint;
}
public void setTrack(Node track) {
this.track = track;
}
// private
/**
* 得到最近的航迹点
*/
private Node getNearstTrackpoints(){
NodeList nl = ItemValue.getTracksPoint(this.track);
double mindis = 10000,temp;
Node mintp = null;
for (int i = 0; i < nl.getLength(); i++) {
temp = getDis(waypoint,nl.item(i));
if (temp < mindis) {
mindis = temp;
mintp = nl.item(i);
}
}
return mintp;
}
private double getDis(Node wpt,Node trackpoint){
double wpt_x = Double.parseDouble(ItemValue.getWaypointX(wpt));
double wpt_y = Double.parseDouble(ItemValue.getWaypointY(wpt));
double tp_x = Double.parseDouble(ItemValue.getTracksPointX(trackpoint));
double tp_y = Double.parseDouble(ItemValue.getTracksPointY(trackpoint));
return Math.sqrt((wpt_x - tp_x) * (wpt_x - tp_x) + (wpt_y - tp_y) * (wpt_y - tp_y));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -