📄 printtrackpoints.java
字号:
package net.aetherial.gis.test.tools;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.io.File;
import net.aetherial.gis.surface.CreateFile;
import net.aetherial.gis.publicuse.StringOper;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.jiaotongbu.input.analyse.OpenDirect;
/**
* <p>标题: 农村公路数据采集与核对工具</p>
*
* <p>描述: </p>
*
* <p>版权: Copyright (c) 2006</p>
*
* <p>公司: 安徽省通途信息技术公司</p>
*
* @author 王爱国
* @version 1.0
*/
public class PrintTrackPoints {
private String inputPath = "";
private String outputPath = "";
private FrameOur fo = null;
public PrintTrackPoints() {
}
public void run(){
String n = "";
OpenDirect od = new OpenDirect();
od.setGradeStr("国道|省道|县道|乡道|村道");
File[] allgps = od.getAllGPSFiles(this.inputPath);
for (int i = 0;allgps != null && i < allgps.length; i++) {
n += this.getAFileString(allgps[i]);
}
this.createFile(n);
}
private String getAFileString(File gpsFile){
String n = "";
this.fo.openFile(gpsFile);
Node[] nodes = ItemValue.getTracks();
NodeList nl = null;
for (int i = 0; i < nodes.length; i++) {
nl = ItemValue.getTracksPoint(nodes[i]);
for (int j = 0; j < nl.getLength(); j++) {
n += ItemValue.getTracksNumber(nodes[i]) + "\t";
n += ItemValue.getTracksName(nodes[i]) + "\t";
n += ItemValue.getTracksPointX(nl.item(j)) + "\t";
n += ItemValue.getTracksPointY(nl.item(j)) + "\t";
n += ItemValue.getTracksPointZ(nl.item(j)) + "\t";
n += "\r\n";
}
}
this.fo.reset();
return n;
}
private void createFile(String str) {
CreateFile cf = new CreateFile(new File(StringOper.getSplashPath(outputPath) +
"log2.txt"));
cf.setEncode("GB2312");
cf.memoryToFile(str);
}
public static void main(String args[]) {
PrintTrackPoints print = new PrintTrackPoints();
print.setFo(new FrameOur()); print.setInputPath("E:\\test\\12\\1");
print.setOutputPath("E:\\test\\13");
print.run();
}
public void setInputPath(String inputPath) {
this.inputPath = inputPath;
}
public void setOutputPath(String outputPath) {
this.outputPath = outputPath;
}
public void setFo(FrameOur fo) {
this.fo = fo;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -