Dotspatial 空间要素选择
//通过遍历选择要素,获取选择要素相交的要素
private void toolStripButton43_Click(object sender, EventArgs e)
{
//查看与选中要素重叠的要素
if (map1.Layers.Count == 0)
{
return;
}
//重叠分析
//遍历要素,显示面积
PolygonLayer pLayer = map1.Layers[0] as PolygonLayer;
FeatureSet fs = null;
fs = (FeatureSet) map1.Layers[0].DataSet;
if (pLayer.Selection.Count == 0)
{
MessageBox.Show("无选中记录", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// //遍历选择要素
foreach (Feature feature in pLayer.Selection.ToFeatureList())
{
////实现方式1==================
IEnvelope pEnvelope = null;
pLayer.Select(null, feature.Envelope, SelectionMode.Intersects, out pEnvelope);
////实现方式2=================
//FeatureSet pPolygonFeatureSet = new FeatureSet(DotSpatial.Topology.FeatureType.Polygon);
////pPolygonFeatureSet.Projection = KnownCoordinateSystems.Geographic.World.WGS1984;
//pPolygonFeatureSet.AddFeature(feature);
//Extent pAffectedExtent = null;
//var result = fs.Select(pPolygonFeatureSet.Extent);//, out pAffectedExtent,
//foreach (IFeature feature2 in result)
//{
// pLayer.ZoomToSelectedFeatures();
// MessageBox.Show(feature.DataRow["林班号"] + "-" + feature.DataRow["小班号"] + "重叠:" + feature2.DataRow["林班号"] + "-" + feature2.DataRow["小班号"]); //feature2.DataRow.Field<Int64>("林班号").ToString()
//}
//实现方式3
//var gm1 = (DotSpatial.Topology.Geometry)(feature.BasicGeometry);// point
//foreach (IFeature feature2 in fs.Features)
//{
// //MessageBox.Show(feature.DataRow.Field<string>("NAME"));
// var gm2 = (DotSpatial.Topology.Geometry)(feature2.BasicGeometry);
// if (gm2.Overlaps(gm1))
// {
// MessageBox.Show(feature.DataRow["林班号"] + "-" + feature.DataRow["小班号"] + "重叠:" + feature2.DataRow["林班号"] + "-" + feature2.DataRow["小班号"]);
// // code for whatever you want to do
// }
//}
//======================
}
pLayer.ZoomToSelectedFeatures();
}
Dotspatial 空间要素选择的更多相关文章
- AE要素选择(点选和拉框选择)
原文 AE要素选择(点选和拉框选择) 选择一个要素或者一个要素集(FeatureSelection)的方法很多,如IMap::SelectByShape.ILayer::search.IFeature ...
- 浅析 Magento网站建站空间的选择
对 Magento稍有了解的人都知道,作为一个功能异常强大的网络商城程序,Magento的运行对主机空间的要求是非常高的:很多 Magento建站公司都会推荐 VPS 甚至独立服务器来运行 Magen ...
- DotSpatial 删除图层要素
//添加图层后,定义图层,并获取图层 //遍历要素,并进行删除 FeatureSet fs = null; fs = (FeatureSet) map1.Layers[0].DataSet; //要素 ...
- 要素选择变化事件 IActiveViewEvents_SelectionChanged
void IDockableWindowDef.OnCreate(object hook) { m_application = hook as IApplication; m_hookHelper = ...
- AE,按照属性值关系选择要素
if(axMapControl2.LayerCount<=0) { MessageBox.Show("请加载图层后使用该功能","系统提示",Messag ...
- ArcPy批量选择指定属性的要素
在GIS数据处理中,选择数据是十分频繁的操作,常用的是"按属性选择"和"按位置选择",这两个功能虽然比较强大,但有时也不能满足实际需求.比如可能时常会遇到这样一 ...
- ArcGIS空间分析工具
1. 3D分析 1.1. 3D Features toolset 工具 工具 描述 3D Features toolset (3D 要素工具集) Add Z Information 添加 Z 信息 添 ...
- AE选中要素
private void 选中要素ToolStripMenuItem_Click(object sender, EventArgs e) { if(axMapControl2.LayerCount&l ...
- 刑事案件的构成要素 zt
论刑事案件的构成要素 马忠红 2013-03-22 14:05:33 来源:<中国人民公安大学学报:社会科学版>(京)2012年5期 [内容提要]刑事案件是由诸多要素构成的一个系 统. ...
随机推荐
- mysql报错mmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool
mysql以`systemctl start mysqld.service`的方式启动一段时间后发现突然无法启动,尝试重新启动也不能解决问题,排查问题时,先后通过`systemctl status m ...
- 第7章 UserInfo端点(UserInfo Endpoint) - IdentityModel 中文文档(v1.0.0)
OpenID Connect UserInfo端点的客户端库是作为扩展HttpClient方法提供的. 以下代码将访问令牌发送到UserInfo端点: var client = new HttpCli ...
- WPF TextBox 正则验证 大于等于0 小于等于1 的两位小数
正则:^(0\.\d+|[1-9][0-9]|1)$ TextBox绑定正则验证 <TextBox x:Name="txb" MaxLength="6" ...
- 访问者模式 Visitor 行为型 设计模式(二十七)
访问者模式 Visitor <侠客行>是当代作家金庸创作的长篇武侠小说,新版电视剧<侠客行>中,开篇有一段独白: “茫茫海外,传说有座侠客岛,岛上赏善罚恶二使,每隔十年 ...
- jquery实现照片墙
jquery照片墙 由15张图片构成,大致思路:随机生成所有图片-->点击其中一张变为一张大图-->点击大图又变回多张 主要用到jquery实现 先来看看效果 html: <div ...
- vue slot+传参
插槽分为默认插槽和具名插槽: 默认插槽: //父组件<div> <h3>父组件</h3> <testChild> <div>默认插槽< ...
- 提升机器学习数学基础,这7本书一定要读-附pdf资源
文章发布于公号[数智物语] (ID:decision_engine),关注公号不错过每一篇干货. 来源 | KDnuggets 作者 | Ajit Jaokar 转自 | 新智元 编辑 | 大明 [编 ...
- 你可能不知道的 docker 命令的奇淫怪巧
你可能不知道的 docker 命令的奇淫怪巧 Intro 介绍并收录一些可能会用到的一些简单实用却很少有人用的 docker 命令 dangling images build 自己的 docker 镜 ...
- 深入分析Java I/O 工作机制
前言 : I/O 问题是Web 应用中所面临的主要问题之一.而且是任何编程语言都无法回避的问题,是整个人机交互的核心. java 的I/O类操作在java.io 包下,将近80个子类, 大概可以分成 ...
- 接触新的项目,构建时候报错:Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.7.Final in
详细信息如下: Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.7.Final in http:// ...