zoukankan      html  css  js  c++  java
  • 在TerraExplorer中如何批量根据shape多边形对象创建TerrainModify对象?

    其实,在Skyline中TerrainModify对象就是一个特殊类型Polygon对象,他们的Geometry是可以直接交换使用的;

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script type="text/javascript">
            function SelectShp() {
                try {
                    var sg = CreateSGObj();
                    var iid = sg.ProjectTree.GetNextItem(sg.ProjectTree.RootID, 10);
                    if (sg.ProjectTree.IsLayer(iid)) {
                        var ilyr = sg.ProjectTree.GetLayer(iid);
                        var gid = CreateGroup("地形修整");
                        for (var i = 0; i < ilyr.FeatureGroups.Polygon.Features.Count; i++) {
                            var iGeometry = ilyr.FeatureGroups.Polygon.Features(i).Geometry;
                            sg.Creator.CreateTerrainModifier(iGeometry, 0, 0, 1, gid);
                        }
                    }
                }
                catch (e) {
                    alert(e);
                }
            }
            function CreateGroup(gname) {
                var sg = CreateSGObj();
                var gid = sg.ProjectTree.FindItem(gname);
                if (gid != "" && gid != 0) {
    
                }
                else {
                    gid = sg.ProjectTree.CreateGroup(gname, sg.ProjectTree.RootID);
                }
                return gid;
            }
            //------------------------------------------------------------
            // 创建sgworld对象  赵贺 2013.09.11.
            //------------------------------------------------------------
            function CreateSGObj() {
                var obj = $("sgworld");
                if (obj == null) {
                    obj = document.createElement('object');
                    document.body.appendChild(obj);
                    obj.name = "sgworld";
                    obj.id = "sgworld";
                    obj.classid = "clsid:3a4f9197-65a8-11d5-85c1-0001023952c1";
                }
                return obj;
            }
            function $(id) {
                return window.document.getElementById(id);
            }
        </script>
    </head>
    <body>
        <input id="Button1" type="button" value="选择SHP" onclick="SelectShp()" />    
    </body>
    </html>
  • 相关阅读:
    HDU 2176 取(m堆)石子游戏 (尼姆博奕)
    HDU 1846 Brave Game (巴什博弈)
    HDU-1025 Constructing Roads In JGShining's Kingdom
    FOJ有奖月赛-2015年11月 Problem B 函数求解
    FOJ有奖月赛-2015年11月 Problem A
    JXNU acm选拔赛 不安全字符串
    JXNU acm选拔赛 涛神的城堡
    JXNU acm选拔赛 涛涛的Party
    JXNU acm选拔赛 壮壮的数组
    JXNU acm选拔赛 最小的数
  • 原文地址:https://www.cnblogs.com/yitianhe/p/3318715.html
Copyright © 2011-2022 走看看