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

📄 tosection.java

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

import org.w3c.dom.*;
import net.aetherial.gis.surface.ItemValue;
import java.util.Vector;
/**
 * <p>Title: </p>
 *
 * <p>Description: 这个类的作用是生成一小段一小段,根据航点来生成
 * 新生成的航迹不包括航点
 *
 * </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ToSection {
  private boolean isByRSChanged = false;
  public ToSection() {
  }

  /**
   * 设置条件
   */
  public void setConditionByRSChanged(){
    this.isByRSChanged = true;
  }

  /**
   * 得到航迹的所有航迹点
   */
  private Node[] getTracksPoints(Node trk){
    Node[] points = null;
    NodeList nl = ItemValue.getTracksPoint(trk);
    if (nl == null) {
      return null;
    }
    points = new Node[nl.getLength()];
    for (int i = 0; i < points.length; i++) {
      points[i] = nl.item(i);
    }
    return points;
  }

  /**
   * 得到适合条件的航点
   */
  private Node[] getFitConditionWPTS(Node trk){
    Node[] wpts = ItemValue.getTracksWaypoint(trk);
    Vector ve = new Vector();
    if (wpts == null) {
      return null;
    }
    /**
     * 如果满足路面变化的条件,按照这样的方法
     */
    if (this.isByRSChanged) {
      for (int i = 0; i < wpts.length; i++) {
        if (!(ItemValue.getWaypointRS(wpts[i]).equals(""))) {
          ve.add(wpts[i]);
        }
      }
    }
    /**
     * 如果有其他条件,类似上面的做法,即可
     */
    if (ve.size() == 0) {
      return null;
    }else{
      Node[] newWpts = new Node[ve.size()];
      for (int i = 0; i < newWpts.length; i++) {
        newWpts[i] = (Node)ve.elementAt(i);
      }
      return newWpts;
    }
  }
//
//  private
}




⌨️ 快捷键说明

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