ITopologicalOperator.Intersect,这是如何工作的?
我试图将一个层的所有功能与另一个层的所有功能相交,但在执行“ConstructUnion”函数时,我的 Web ADF 应用程序卡住了
这是我到目前为止编写的代码
// create a geometrybag for layer1
ESRI.ArcGIS.Geometry.IGeometry geometryBag = new ESRI.ArcGIS.Geometry.GeometryBagClass();
geometryBag.SpatialReference = m_firstLayerFirstfeatureIGeometry.SpatialReference;
ESRI.ArcGIS.Geometry.IGeometryCollection geometryCollection = (ESRI.ArcGIS.Geometry.IGeometryCollection)geometryBag;
// Cycle all features of first layer and add them to the collection
foreach (DataRow m_dr in m_firstLayerfeatureGraphics.Rows)
{
// Takes this feature's geometry
ESRI.ArcGIS.ADF.Web.Geometry.Geometry adfFeature =
m_firstLayerfeatureGraphics.GeometryFromRow(m_dr) as ESRI.ArcGIS.ADF.Web.Geometry.Geometry;
// convert to a igeometry object
ESRI.ArcGIS.Geometry.IGeometry m_tempfeatureIGeometry =
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Local.Converter.ToIGeometry(adfFeature, ctx);
System.Diagnostics.Debug.WriteLine("m_firstLayerfeatureGraphics +1 ");
object missing = Type.Missing;
geometryCollection.AddGeometry(m_tempfeatureIGeometry, ref missing, ref
missing);
}
ESRI.ArcGIS.Geometry.ITopologicalOperator mtopo1 = new ESRI.ArcGIS.Geometry.PolygonClass();
// FOLLOWING LINE BLOCKS APPLICATION
mtopo1.ConstructUnion((ESRI.ArcGIS.Geometry.IEnumGeometry)geometryBag);
知道为什么吗?
I'm trying to intersect all features of a layer with another's but I'm getting the web ADF application stuck while executing the "ConstructUnion" function
Here's the code I've written so far
// create a geometrybag for layer1
ESRI.ArcGIS.Geometry.IGeometry geometryBag = new ESRI.ArcGIS.Geometry.GeometryBagClass();
geometryBag.SpatialReference = m_firstLayerFirstfeatureIGeometry.SpatialReference;
ESRI.ArcGIS.Geometry.IGeometryCollection geometryCollection = (ESRI.ArcGIS.Geometry.IGeometryCollection)geometryBag;
// Cycle all features of first layer and add them to the collection
foreach (DataRow m_dr in m_firstLayerfeatureGraphics.Rows)
{
// Takes this feature's geometry
ESRI.ArcGIS.ADF.Web.Geometry.Geometry adfFeature =
m_firstLayerfeatureGraphics.GeometryFromRow(m_dr) as ESRI.ArcGIS.ADF.Web.Geometry.Geometry;
// convert to a igeometry object
ESRI.ArcGIS.Geometry.IGeometry m_tempfeatureIGeometry =
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Local.Converter.ToIGeometry(adfFeature, ctx);
System.Diagnostics.Debug.WriteLine("m_firstLayerfeatureGraphics +1 ");
object missing = Type.Missing;
geometryCollection.AddGeometry(m_tempfeatureIGeometry, ref missing, ref
missing);
}
ESRI.ArcGIS.Geometry.ITopologicalOperator mtopo1 = new ESRI.ArcGIS.Geometry.PolygonClass();
// FOLLOWING LINE BLOCKS APPLICATION
mtopo1.ConstructUnion((ESRI.ArcGIS.Geometry.IEnumGeometry)geometryBag);
Any idea why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如该网站的GIS版本所述,这就是解决方案
As stated in GIS version of this website, this is the solution