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

📄 detach.java

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

import net.aetherial.gis.our.auto.Auto;
import net.aetherial.gis.our.FrameOur;
import org.w3c.dom.Node;
import net.aetherial.gis.surface.ItemValue;
import java.io.File;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 * How To Use
 *   Detach detach = new Detach(this);
 *   detach.setDirectory("D:\\GIS\\GPS测量数据\\整理完毕\\瑶海区\\");
 *   detach.Save("D:\\GIS\\GPS测量数据\\分类型\\瑶海区.txt",detach.getAllGrade());
 *   detach.msg("OK");
 *
 *
 *
 */
public class Detach
    extends Auto {
  java.text.DecimalFormat df = new java.text.DecimalFormat("#.0000");
  public Detach(FrameOur fo) {
    this.setFrameOur(fo);
  }
  public void setDirectory(String inputDirectory){
    super.setDirectory(inputDirectory,"");
  }
  public String getGrade(String grade){
    String n = "";
    int[] pos = ItemValue.getPosition("track");
    Node node = null;
    for (int i = 0; i < pos.length; i++) {
      node = ItemValue.getTracks(pos[i]);
      if (ItemValue.getTracksGrade(node).equals(grade)) {
        n = n + grade + ":" + ItemValue.getTracksName(node) + "," + ItemValue.getTracksType(node) + "," + ItemValue.getTracksWidth(node) + "\r\n";
      }
    }
    return n;
  }
  public String getType(String type){
    String n = "";
    int count = 0;
    int[] pos = ItemValue.getPosition("track");
    Node node = null;
    for (int i = 0; i < pos.length; i++) {
      node = ItemValue.getTracks(pos[i]);
      if (ItemValue.getTracksType(node).equals(type)) {
        count++;
        n = n + "\""+ItemValue.getTracksName(node)+"\",";//道路名称
        //n = n + "\""+ItemValue.getTracksT1(node)+"\",";//市
        n = n + "\""+ItemValue.getTracksT2(node)+"\",";//县
        n = n + "\""+ItemValue.getTracksT3(node)+"\",";//乡
        //n = n + "\""+ItemValue.getTracksT4(node)+"\",";//村
        n = n + "\""+ItemValue.getTracksGrade(node)+"\",";//行政等级
        n = n + "\""+ItemValue.getTracksType(node)+"\",";//路面类型
        n = n + "\""+ItemValue.getTracksWidth(node)+"\",";//路面宽度
        n = n + "\""+df.format(ItemValue.getTracksDistance(node))+"\",";//里程
        n = n + "\""+ItemValue.getTracksT3(node)+"."+count+".xls\",";//坐标文件
        //n = n + "\""+ItemValue.getTracksStructure(node)+"\",";//路面结构
        n = n + "\""+ItemValue.getTracksStatus(node)+"\"";//路面状态
        n = n + "\r\n";
        //n = n + type + ":" + ItemValue.getTracksName(node) + "," + ItemValue.getTracksGrade(node) + "," + ItemValue.getTracksWidth(node) + "\r\n";
      }
    }
    return n;
  }

  public String getAllOnlyType(String type){
    if(super.input == null){
      System.out.println("super.input");
      return "";
    }
    String n = "";
    for (int i = 0; i < this.input.length; i++) {
      this.open(this.input[i]);
      n = n + this.getType(type);
      this.setMemoryReset();
    }
    return n;
  }

  public String getAllType(){
    if(super.input == null){
      System.out.println("super.input");
      return "";
    }
    String n = "";
    String[] type = {"水泥", "油路","砂石路", "土路"};
    for(int j=0;j<type.length;j++){
      for (int i = 0; i < this.input.length; i++) {
        this.open(this.input[i]);
        n = n + this.getType(type[j]);
        this.setMemoryReset();
      }
    }
    return n;
  }

  public String getAllGrade(){
    if(super.input == null){
      System.out.println("super.input");
      return "";
    }
    String n = "";
    String[] grade = {"省道","县道","乡道","村道"};
    for(int j=0;j<grade.length;j++){
      for (int i = 0; i < this.input.length; i++) {
        this.open(this.input[i]);
        n = n + this.getGrade(grade[j]);
        this.setMemoryReset();
      }
    }
    return n;
  }
}
/*
How to use this:
  Detach detach = new Detach(this);

*/

⌨️ 快捷键说明

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