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

相关文章:

  • 2022-12-23
  • 2021-10-29
  • 2021-10-09
  • 2021-12-01
  • 2022-12-23
  • 2021-11-29
  • 2021-10-18
  • 2021-05-08
猜你喜欢
  • 2021-05-31
  • 2021-08-17
  • 2021-10-07
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案