管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2024-01-11 122511b3a46bc66b82f2de9ee0b6ef43a05b1081
1
已修改2个文件
86 ■■■■ 文件已修改
TEWin/Resources/SpaceStatistics/SpaceStatistics.html 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/sample.fly 补丁 | 查看 | 原始文档 | blame | 历史
TEWin/Resources/SpaceStatistics/SpaceStatistics.html
@@ -24,6 +24,7 @@
    var gAsync = true;
    var gDebug = false;
    var groupName = "空间统计";
    var layerName = "JMD_1002";
    var rs = {
      count: 0, // 要素总个数
@@ -34,18 +35,38 @@
      volume: 0, // 三维体体积
      minHeight: 0, // 三维体最低高度
      maxHeight: 0, // 三维体最高高度
      reset: function () {
        this.count = 0;
        this.lineLen = 0;
        this.polyArea = 0;
        this.valueOf = 0;
        this.volume = 0;
        this.minHeight = 0;
        this.maxHeight = 0;
        return this;
      },
      format: function () {
        this.lineLen = parseFloat(this.lineLen.toFixed(2));
        this.polyArea = parseFloat(this.polyArea.toFixed(2));
        this.volume = parseFloat(this.volume.toFixed(2));
        this.minHeight = parseFloat(this.minHeight.toFixed(2));
        this.maxHeight = parseFloat(this.maxHeight.toFixed(2));
        return this;
      },
      setVal: function () {
        $("#totalNum").html(this.count.toString());
        $("#lineLen").html(this.lineLen.toString());
        $("#polyArea").html(this.polyArea.toString());
        $("#volume").html(this.volume.toString());
        $("#totalNum").html("" + this.count);
        $("#lineLen").html("" + this.lineLen);
        $("#polyArea").html("" + this.polyArea);
        $("#volume").html("" + this.volume);
        $("#minHeight").html("" + this.minHeight);
        $("#maxHeight").html("" + this.maxHeight);
      }
    };
@@ -75,7 +96,7 @@
    }
    function getFeatureLayers() {
      var layers = [], index = 0;
      var layers = [];
      BuildObjectsList(SGWorld.ProjectTree.RootID, layers, 36);
      return layers;
@@ -88,7 +109,7 @@
    }
    function startQuery(e) {
      delGroup();
      this.clear();
      if (drawing.drawingEditMode != -1) {
        drawing.abort();
        return;
@@ -110,8 +131,46 @@
    }
    function DrawPoly(geometry, type, altitudeType) {
      SGWorld.ProjectTree.EnableRedraw(0);
      //alert(null==geometry);
      var layers = getFeatureLayers();
      for (var i in layers) {
        try {
          var layer = SGWorld.ProjectTree.GetObject(layers[i]);
          var fs = layer.ExecuteSpatialQuery(geometry, 1); // 1-IT_INTERSECT, 2-IT_WITHIN
          if (fs.Count == 0) continue;
          rs.count += fs.Count;
          if (layer.GeometryType == 1) { // LGT_POLYLINE
            for (var j = 0; j < fs.Count; j++) {
              var f = fs.Item(j);
              rs.lineLen += f.Geometry.Length;
            }
            continue;
          }
          if (layer.GeometryType == 2) { // LGT_POLYGON
            var flag = layerName == layer.TreeItem.Name;
            for (var j = 0; j < fs.Count; j++) {
              var f = fs.Item(j);
              rs.polyArea += f.Geometry.Area;
              if (flag) {
                var maxHeight = f.FeatureAttributes.GetFeatureAttribute("MaxHeight").Value;
                var minHeight = f.FeatureAttributes.GetFeatureAttribute("MinHeight").Value;
                var height = maxHeight - minHeight;
                rs.volume += f.Geometry.Area * height;
                if (rs.maxHeight < height) rs.maxHeight = height;
                if (!rs.minHeight || rs.minHeight > height) rs.minHeight = height;
              }
            }
          }
        } catch (e) {
          layers.splice(i, 1);
        }
      }
      rs.format();
      rs.setVal();
    }
    function ResetAsync(FirstTime, FromMouseInputMode) {
@@ -167,7 +226,7 @@
            <td class="s8b">
              <label for="Mode" class="i18n">线对象长度</label>
            </td>
            <td>&nbsp;<span id="lineLen">0</span> 千米
            <td>&nbsp;<span id="lineLen">0</span> 米
            </td>
          </tr>
          <tr>
@@ -184,6 +243,13 @@
            <td>&nbsp;<span id="volume">0</span> 立方米
            </td>
          </tr>
          <tr>
            <td class="s8b">
              <label for="Mode" class="i18n">三维体高度</label>
            </td>
            <td>&nbsp;最低 <span id="minHeight">0</span> 米,最高 <span id="maxHeight">0</span> 米
            </td>
          </tr>
        </table>
      </td>
    </tr>
TEWin/Resources/sample.fly
Binary files differ