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);

最新文章

  1. Java中静态内部类的理解
  2. Java笔试题(一)
  3. HTML-学习笔记(文本格式化,引用,计算机代码)
  4. SQL Server中行列转换
  5. poj 3258 River Hopscotch(二分+贪心)
  6. 【USACO 1.1.1】你的飞碟在这儿
  7. AFNetworking (3.1.0) 源码解析 &lt;四&gt;
  8. Flask学习记录之Flask-Mail
  9. mysql和VS2010 C++链接过程中出现的问题
  10. [Python]Unicode转ascii码的一个好方法
  11. CodeForces 22B Bargaining Table 简单DP
  12. 更改自身web项目的图标(默认为tomcat的小喵咪)
  13. DOS学习札记(一)
  14. &quot;《算法导论》之‘图’&quot;:单点最短路径(有向图)
  15. Workbench热水泵系统
  16. git 从远程拉取代码、推代码的步骤
  17. Beta版本冲刺(一)
  18. js跨域问题解释 使用jsonp或jQuery的解决方案
  19. Valgrind memcheck 8种错误实例
  20. copy and paste ,做到这样也很牛逼了

热门文章

  1. centos 开机启动服务
  2. spring-boot启动信息中non-fatal error
  3. openssl pem 生成公钥和私钥及文件
  4. SQLiteOpenHelper的使用
  5. JAVA中的正则表达式
  6. .net预览功能
  7. USB通信协议——深入理解
  8. SQL SERVER 2005 DBCC IND命令说明
  9. angularJs,ionic字符串操作
  10. php学习笔记之wamp安装配置