• 大小: 1.47MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-15
  • 语言: C#
  • 标签: sharpmap  c#  

资源简介

sharpmap实现shp的加载,c#例子

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace sharpmapDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

        }

        private void Form1_Load(object sender EventArgs e)
        {
            SharpMap.layers.Vectorlayer vlay = new SharpMap.layers.Vectorlayer(“States“);
            vlay.DataSource = new SharpMap.Data.Providers.ShapeFile(@“G:\Gis程序\sharpmapDemo\sharpmapDemo\path_to_data\states_ugl.shp“ true);
            //vlay.DataSource = new SharpMap.Data.Providers.ShapeFile(@“D:\sharpmap\waterways.shp“ true);
            mapBox1.Map.layers.Add(vlay);
            /*
            SharpMap.Rendering.Thematics.GradientTheme popdens = new SharpMap.Rendering.Thematics.GradientTheme(“PopDens“ 0 400
   new SharpMap.styles.Vectorstyle() new SharpMap.styles.Vectorstyle());
            //We can make more advanced coloring using the ColorBlend‘er.
            //Setting the FillColorBlend will override any fill-style in the min and max fills.
            //In this case we just use the predefined Rainbow colorscale
            popdens.FillColorBlend = SharpMap.Rendering.Thematics.ColorBlend.Rainbow5;
            vlay.Theme = popdens;

            vlay.style.EnableOutline = true;
            vlay.style.PointColor = new SolidBrush(Color.Red);
            vlay.style.PointSize = 13;
            vlay.style.Line.Color = Color.Green;*/

            mapBox1.Map.ZoomToExtents();
            mapBox1.Refresh();
            mapBox1.ActiveTool = SharpMap.Forms.MapBox.Tools.Pan;//设置平移
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-06-28 09:55  sharpmapDemo\
     目录           0  2016-06-28 10:30  sharpmapDemo\sharpmapDemo\
     文件         878  2016-06-28 09:55  sharpmapDemo\sharpmapDemo.sln
     文件       41984  2016-06-28 11:04  sharpmapDemo\sharpmapDemo.suo
     文件         144  2016-06-28 10:29  sharpmapDemo\sharpmapDemo\app.config
     目录           0  2016-06-28 09:55  sharpmapDemo\sharpmapDemo\bin\
     目录           0  2016-06-28 10:25  sharpmapDemo\sharpmapDemo\bin\Debug\
     文件       40448  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\BruTile.Desktop.dll
     文件      110080  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\BruTile.dll
     文件       49152  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\Common.Logging.dll
     文件       57344  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\GeoAPI.dll
     文件      549376  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\NetTopologySuite.dll
     文件      391680  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\Newtonsoft.Json.dll
     文件      440219  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\Newtonsoft.Json.xml
     文件      189952  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\PowerCollections.dll
     文件       89088  2013-07-22 19:32  sharpmapDemo\sharpmapDemo\bin\Debug\ProjNet.dll
     文件      464896  2013-07-22 20:21  sharpmapDemo\sharpmapDemo\bin\Debug\SharpMap.dll
     文件     1148416  2013-07-22 20:21  sharpmapDemo\sharpmapDemo\bin\Debug\SharpMap.pdb
     文件       96256  2013-07-22 20:21  sharpmapDemo\sharpmapDemo\bin\Debug\SharpMap.UI.dll
     文件      126464  2013-07-22 20:21  sharpmapDemo\sharpmapDemo\bin\Debug\SharpMap.UI.pdb
     文件       29946  2013-07-22 20:21  sharpmapDemo\sharpmapDemo\bin\Debug\SharpMap.UI.xml
     文件      792989  2013-07-22 20:21  sharpmapDemo\sharpmapDemo\bin\Debug\SharpMap.xml
     文件        9216  2016-06-28 10:43  sharpmapDemo\sharpmapDemo\bin\Debug\sharpmapDemo.exe
     文件         144  2016-06-28 10:29  sharpmapDemo\sharpmapDemo\bin\Debug\sharpmapDemo.exe.config
     文件       24064  2016-06-28 10:43  sharpmapDemo\sharpmapDemo\bin\Debug\sharpmapDemo.pdb
     文件       11600  2016-06-28 10:51  sharpmapDemo\sharpmapDemo\bin\Debug\sharpmapDemo.vshost.exe
     文件         144  2016-06-28 10:29  sharpmapDemo\sharpmapDemo\bin\Debug\sharpmapDemo.vshost.exe.config
     文件         490  2015-10-30 15:19  sharpmapDemo\sharpmapDemo\bin\Debug\sharpmapDemo.vshost.exe.manifest
     文件        1791  2016-06-28 10:54  sharpmapDemo\sharpmapDemo\Form1.cs
     文件        2751  2016-06-28 10:28  sharpmapDemo\sharpmapDemo\Form1.Designer.cs
     文件        5817  2016-06-28 10:28  sharpmapDemo\sharpmapDemo\Form1.resx
............此处省略27个文件信息

评论

共有 条评论