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

Dotspatial 创建面状图层的更多相关文章

  1. DotSpatial 创建面状要素——含空洞

    private void toolStripButton23_Click(object sender, EventArgs e) { //选择图层 FeatureSet fs = null; fs = ...

  2. 用IFeatureWorkspaceAnno.CreateAnnotationClass 创建注记图层时报“The application is not licensed to modify or create schema”的错误的解决方案。

    用IFeatureWorkspaceAnno.CreateAnnotationClass 的方法创建注记图层的时候报"The application is not licensed to m ...

  3. ArcEngine 创建线要素图层

    在创建要素图层的时候,默认的几何类型是Polygon: Dim objectClassDescription As IObjectClassDescription = New FeatureClass ...

  4. Yii 2.0: yii2-highcharts-widget创建饼状图

    安装 The preferred way to install this extension is through composer. 项目根目录下执行: php composer.phar requ ...

  5. 创建注记图层C# IFeatureWorkspaceAnno

    http://blog.csdn.net/mydriverc/article/details/1675613     //IFeatureWorkspaceAnno Example     //The ...

  6. IOS 创建渐变图层

    代码如下 typedef enum { GradientLayerKindLeftRight = , GradientLayerKindUpDown, GradientLayerKindLBRT,// ...

  7. C# ArcEngine创建内存图层(转载)

    C#+Arcengine---创建内存图层 分类:技术文档 2009-12-11 14:43阅读(1498)评论(0) #region 在内存中创建图层        /// <summary& ...

  8. GDAL不支持创建PCIDSK的面状矢量格式

    最近在使用GDAL创建PCIDSK格式的矢量数据,发现创建点和线的矢量数据都没问题,创建面状的只有属性表没有图形.在GDAL官网说明也写的是支持的,地址为:http://www.gdal.org/fr ...

  9. Java创建柱状图及饼状图

    Java创建图表其实还是很方便的,但是要引入相关的jar包.如下 jfreechart.jar jcommon,jar gnujaxp.jar 其中最主要的是jfreechart.jar. 下面就让我 ...

随机推荐

  1. spring+task配置

    1.spring+task文件配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=& ...

  2. C++ STL vector容器学习

    STL(Standard Template Library)标准模板库是C++最重要的组成部分,它提供了一组表示容器.迭代器.函数对象和算法的模板.其中容器是存储类型相同的数据的结构(如vector, ...

  3. 嵌入式Linux学习笔记(0)基础命令。——Arvin

    学习记录: 到今天为止ARM裸机开发学习进程:1.2.1-1.2.14 预科班知识Linux介绍学习进程:0.2.1-0.2.6 学习内容笔记: 学习了Linux的开发方式的优劣介绍 学习了常用文件夹 ...

  4. Android 自定义Adapter 但listview 只显示第一条数据

    <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content ...

  5. 【cpp】Vector

    这vector 很有用 // compile with: /EHsc #include <vector> #include <iostream> int main() { us ...

  6. ATC空管系统的实时控制软件系统分析

    什么是ATC空管系统? 空中交通管制的目的是对航空器的空中活动进行有效的管理,维护空中交通秩序,保障空中交通畅通,保证飞行安全和提高飞行效率,防止航空器相撞,防止机场及其附近空域的航空器同障碍物相撞. ...

  7. e.Tomcat中的sendfile支持

    sendfile实质是linux系统中一项优化技术,用以发送文件和网络通信时,减少用户态空间与磁盘倒换数据,而直接在内核级做数据拷贝,这项技术是linux2.4之后就有的,现在已经很普遍的用在了C的网 ...

  8. [WPF]MenuItem右侧空白

    <Window> <Grid Background="SteelBlue"> <Grid.ContextMenu> <ContextMen ...

  9. 在iframe父界面获取iframe里面的标签

    上一篇里边介绍了在里边利用iframe引入另一个html导航文件,有兴趣的朋友可以看一看 http://www.cnblogs.com/simba-lkj/p/6031662.html 目前遇到一些问 ...

  10. IT求职中,笔试、面试的算法准备

    PS:此文章为转载,源地址:http://www.newsmth.net/nForum/#!article/CoderInterview/849     作者应该是在美国进行的笔试面试,感觉面试的的公 ...