📄 lxrecord.java
字号:
package net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.gpsdata.lxld;
import org.w3c.dom.Node;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.gpsdata.lxld.lx.TwoNode;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.gpsdata.lxld.lx.LXBEPoint;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.jiaotongbu.output.publicuse.Item;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.gpsdata.lxld.lx.Depart;
import java.util.Vector;
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 LXRecord {
private Node trk = null;
/**
* 给定的路线航迹---两个节点代表一条路线
*/
private TwoNode ttrk = null;
private LXBEPoint be = null;
private Node begin = null,end = null;
private Vector nodes = null;
private String name = "";
public LXRecord() {
}
public LXRecord(String key, Vector nodes) {
this. name = key;
this.nodes = nodes;
}
public LXRecord(Node trk) {
this.trk = trk;
this.ttrk = null;
}
public LXRecord(TwoNode ttrk) {
this.ttrk = ttrk;
this.trk = null;
}
public void setLXBEPoint(LXBEPoint be) {
this.be = be;
this.be.setTrack(this.trk);
this.be.setTwoNode(null);
this.be.scanToGetBE(this.nodes);
this.begin = this.be.getBPoint();
this.end = this.be.getEPoint();
this.be.reset();
}
public String getRoadName(){
return this.name;
// if (this.trk != null) {
// return ItemValue.getTracksName(this.trk);
// }else{
// return ItemValue.getTracksName(this.ttrk.getNode1());
// }
// return ItemValue.getWaypointName(this.begin) + "-" + ItemValue.getWaypointName(this.end);
}
public String getNumber(){
return (String) ItemValue.numberedTracks.get(name);
// if (this.trk != null) {
// return ItemValue.getTracksNumber(this.trk);
// }
// else {
// return ItemValue.getTracksNumber(this.ttrk.getNode1());
// }
}
public String getBName(){
return ItemValue.getWaypointName(this.begin);
}
public String getBLongitude(){
NodeList nl = ItemValue.getTracksPoint((Node)nodes.get(0));
Node begin = nl.item(0);
return ItemValue.getTracksPointX(begin);
}
public String getBLatitude(){
NodeList nl = ItemValue.getTracksPoint((Node)nodes.get(0));
Node begin = nl.item(0);
return ItemValue.getTracksPointY(begin);
}
public String getBIsFenjie(){
return "2";
}
public String getBFenjieType(){
return "";
}
public String getBDepart(){
Depart dp = new Depart(this.begin);
dp.setTrk((Node)nodes.get(0));
return dp.getXiangzhenBianma();
}
public String getEName(){
return ItemValue.getWaypointName(this.end);
}
public String getELongitude(){
NodeList nl = ItemValue.getTracksPoint((Node)nodes.get(nodes.size()-1));
Node end = nl.item(nl.getLength()-1);
return ItemValue.getTracksPointX(end);
}
public String getELatitude(){
NodeList nl = ItemValue.getTracksPoint((Node)nodes.get(nodes.size()-1));
Node end = nl.item(nl.getLength()-1);
return ItemValue.getTracksPointY(end);
}
public String getEIsFenjie(){
return "2";
}
public String getEFenjieType(){
return "";
}
public String getEDepart(){
Depart dp = null;
if(nodes.size() < 2){
dp = new Depart(this.begin);
dp.setTrk((Node)nodes.get(0));
return dp.getXiangzhenBianma();
}else{
dp = new Depart(this.end);
dp.setTrk((Node)nodes.get(nodes.size()-1));
return dp.getXiangzhenBianma();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -