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

📄 currentreverse.java

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

import net.aetherial.gis.surface.ItemValue;
import org.w3c.dom.Node;
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 CurrentReverse {
  public CurrentReverse() {

  }

  public Node reverse(Node trk) {
      if (trk == null) {
        return null;
      }
      NodeList nl1 = ItemValue.getTracksPoint(trk);
      String[] x = new String[nl1.getLength()], y = new String[nl1.getLength()],
          z = new String[nl1.getLength()];
      for (int i = 0; i < nl1.getLength(); i++) {
        x[i] = ItemValue.getTracksPointX(nl1.item(i));
        y[i] = ItemValue.getTracksPointY(nl1.item(i));
        z[i] = ItemValue.getTracksPointZ(nl1.item(i));
      }

//    double startX = Double.parseDouble(x[0]);
//    double startY = Double.parseDouble(y[0]);
//    double endX = Double.parseDouble(x[x.length-1]);
//    double endY = Double.parseDouble(y[y.length-1]);
//
//    if(endX < startX || endY < startY){
      int length = nl1.getLength();
      for (int i = 0; i < length; i++) {
        nl1.item(i).getChildNodes().item(0).getChildNodes().item(0).setNodeValue(
            x[length - 1 - i]);
        nl1.item(i).getChildNodes().item(1).getChildNodes().item(0).setNodeValue(
            y[length - 1 - i]);
        nl1.item(i).getChildNodes().item(2).getChildNodes().item(0).setNodeValue(
            z[length - 1 - i]);
      }
//    }
      return trk;
  }
}

⌨️ 快捷键说明

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