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