Dotspatial 创建面状图层
using DotSpatial.Controls;
using DotSpatial.Data;
using DotSpatial.Data.Forms;
using DotSpatial.Plugins.Measure;
using DotSpatial.Symbology;
using DotSpatial.Topology;
using DotSpatial.Topology.Algorithm;
using Point = DotSpatial.Topology.Point;
using PointShape = DotSpatial.Symbology.PointShape;
Shapefile s = new Shapefile();
//面状要素
FeatureSet fs = new FeatureSet(FeatureType.Polygon);
//增加字段
fs.DataTable.Columns.Add(new DataColumn("ID", typeof (int)));
fs.DataTable.Columns.Add(new DataColumn("Text", typeof (string)));
//坐标列表
List<Coordinate> vertices = new List<Coordinate>();
vertices.Add(new Coordinate(0, 0));
vertices.Add(new Coordinate(0, 100));
vertices.Add(new Coordinate(100, 100));
vertices.Add(new Coordinate(100, 0));
//创建多边形要素
Polygon geom = new Polygon(vertices);
IFeature feature = fs.AddFeature(geom);
feature.DataRow.BeginEdit();
feature.DataRow["ID"] = 1;
feature.DataRow["Text"] = "Hello world";
feature.DataRow.EndEdit();
//存储
fs.SaveAs("d:\\test.shp", true);
最新文章
- Java中静态内部类的理解
- Java笔试题(一)
- HTML-学习笔记(文本格式化,引用,计算机代码)
- SQL Server中行列转换
- poj 3258 River Hopscotch(二分+贪心)
- 【USACO 1.1.1】你的飞碟在这儿
- AFNetworking (3.1.0) 源码解析 <;四>;
- Flask学习记录之Flask-Mail
- mysql和VS2010 C++链接过程中出现的问题
- [Python]Unicode转ascii码的一个好方法
- CodeForces 22B Bargaining Table 简单DP
- 更改自身web项目的图标(默认为tomcat的小喵咪)
- DOS学习札记(一)
- ";《算法导论》之‘图’";:单点最短路径(有向图)
- Workbench热水泵系统
- git 从远程拉取代码、推代码的步骤
- Beta版本冲刺(一)
- js跨域问题解释 使用jsonp或jQuery的解决方案
- Valgrind memcheck 8种错误实例
- copy and paste ,做到这样也很牛逼了