📄 wpttojtb.java
字号:
package net.aetherial.gis.jiaotongbu.output.type;
import org.w3c.dom.Node;
import net.aetherial.gis.surface.ItemValue;
import java.io.*;
import net.aetherial.gis.jiaotongbu.output.publicuse.Item;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class WptToJTB {
protected String name = "";
protected String trackName = "";
protected String xiangzhen = "";
protected String longitude = "";
protected String latitude = "";
protected String altitude = "";
protected Node wpt = null;
protected Node hisTrack = null;
public WptToJTB(Node wpt) {
this.wpt = wpt;
}
public static String getHead() {
return
"编号,所在乡镇,名称,所在路线名称,经度,纬度,高程\r\n";
}
protected String getName() {
return ItemValue.getWaypointName(wpt);
}
protected String getLongitude() {
return ItemValue.getWaypointX(wpt);
}
protected String getLatitude() {
return ItemValue.getWaypointY(wpt);
}
protected String getAltitude() {
return ItemValue.getWaypointZ(wpt);
}
protected String getTrackName() {
if (hisTrack == null) {
return "未与航迹关联";
}
return "[" + ItemValue.getTracksNumber(hisTrack).toUpperCase() + Item.getSix_6_XianNumber() + ItemValue.getTracks_ld_number(hisTrack)+ "]" + ItemValue.getTracksName(hisTrack);
}
protected String getXiangzhen() {
Node trk = ItemValue.getWaypointHisTrack(wpt);
return ItemValue.getTracksT3(trk);
}
public String getLongitudeX() {
return this.longitude;
}
public String getLatitudeY() {
return this.latitude;
}
public String getAltitudeZ() {
return this.altitude;
}
public String getHisTrackName() {
return this.trackName;
}
public String getHisName() {
return this.name;
}
public String getHisXiangzhen(){
return this.xiangzhen;
}
public boolean isEqualsXYZ(String x, String y, String z) {
if ( (this.longitude.equals(x)) && (this.latitude.equals(y)) &&
(this.altitude.equals(z))) {
return true;
}
else {
return false;
}
}
public boolean isEqualsXYZ(WptToJTB wtj) {
if ( (this.longitude.equals(wtj.getLongitudeX())) &&
(this.latitude.equals(wtj.getLatitudeY())) &&
(this.altitude.equals(wtj.getAltitudeZ()))) {
return true;
}
else {
return false;
}
}
public void setValue() {
if (this.wpt != null) {
this.name = this.getName();
this.trackName = this.getTrackName();
this.xiangzhen = this.getXiangzhen();
this.longitude = this.getLongitude();
this.latitude = this.getLatitude();
this.altitude = this.getAltitude();
this.hisTrack = ItemValue.getWaypointHisTrack(wpt);
}
}
public String getValue() {
try {
return "\"" + this.xiangzhen + "\",\"" +
new String(this.name.getBytes("gb2312")) + "\",\"" + this.trackName +
"\",\"" +
this.longitude + "\",\"" +
this.latitude + "\",\"" + this.altitude + "\"";
}
catch (UnsupportedEncodingException ex) {
return "\"" + this.xiangzhen + "\",\"" +this.name + "\",\"" + this.trackName +
"\",\"" +
this.longitude + "\",\"" +
this.latitude + "\",\"" + this.altitude + "\"";
}
}
public String getARecord() {
try {
return "\"" + this.getXiangzhen() + "\",\"" +
new String(this.getName().getBytes("gb2312")) + "\",\"" +
this.getTrackName() + "\",\"" +
this.getLongitude() + "\",\"" +
this.getLatitude() + "\",\"" + this.getAltitude() + "\"";
}
catch (UnsupportedEncodingException ex) {
return "\"" + this.getXiangzhen() + "\",\"" +
this.getName() + "\",\"" +
this.getTrackName() + "\",\"" +
this.getLongitude() + "\",\"" +
this.getLatitude() + "\",\"" + this.getAltitude() + "\"";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -