zoukankan      html  css  js  c++  java
  • ITopologicalOperator Intersect

       /// <summary>
            /// 判断2个几何图形是否相交
            /// </summary>
            /// <param name="oneGeometry"></param>
            /// <param name="otherGeometry"></param>
            /// <returns></returns>
            public bool Intersect(IGeometry oneGeometry, IGeometry otherGeometry)
            {
                try
                {
                    ISpatialReferenceFactory3 pSRF = new SpatialReferenceEnvironmentClass();
                    ISpatialReference pSR = pSRF.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_Beijing1954);
                    pSR.SetDomain(-400, -400, 400, 400);

                    oneGeometry.SpatialReference = pSR;
                    otherGeometry.SpatialReference = pSR;

                    ITopologicalOperator iTopoOperator = (ITopologicalOperator)oneGeometry;

                   
                    IGeometry outGeometry = iTopoOperator.Intersect(otherGeometry, esriGeometryDimension.esriGeometryNoDimension);
                    if (!outGeometry.IsEmpty)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }          
                }
                catch (Exception ex)
                {
                    return false;
                }
            }

  • 相关阅读:
    高数基础
    java.io.FileNotFoundException: [WEB-INF/spring-servlet.xml] cannot be opened because it does not exist
    HBase1.0.0 实现数据增删查
    cm 安装cdh 后添加hive服务
    HBase启动错误提示别的机器60000已经存在
    CM集群管理
    CM 安装CDH 错误: 安装失败。 无法接收 Agent 发出的检测信号。
    Js运动框架
    单片机DA转换实现正弦波
    怎样让树莓派接移动硬盘
  • 原文地址:https://www.cnblogs.com/threestone/p/1803174.html
Copyright © 2011-2022 走看看