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;
                }
            }

  • 相关阅读:
    进程
    并发编程
    操作系统的发展史
    __init__、__new__、__call__ 方法
    MongoDB文档操作
    MongoDB集合操作
    MongoDB数据库操作
    MongoDB连接
    MongoDB的文档存储结构
    MongoDB 概念
  • 原文地址:https://www.cnblogs.com/threestone/p/1803174.html
Copyright © 2011-2022 走看看