Winform实现Shp-栅格图形文件的读取与显示(外加shp转WKB格式存入oracle)附源码

时间:2022-03-21 16:50:41

前言:上学期GIS空间数据库课程设计时,老师让实现Shp-栅格图形文件的读取与显示,外加shp转WKB格式存入oracle,不使用第三方类库,花了一天时间在网上找了一些资料,实现了一个简单的栅格图形文件的显示。

有时候我们知道了一个文件的存储格式,便可以写个程序轻轻松松读取出来想要的数据,读取的时候自然要用到system.IO来操作IO流。这次我演示的地图矢量数据(实际上就是读取一些点,线,面坐标信息)的读取与可视化显示。下面开始进入正题。

0.成果演示

基本显示

Winform实现Shp-栅格图形文件的读取与显示(外加shp转WKB格式存入oracle)附源码

坐标读取

Winform实现Shp-栅格图形文件的读取与显示(外加shp转WKB格式存入oracle)附源码

1.什么是shp文件

shape文件由ESRI开发,一个ESRI(Environmental Systems Research Institute)的shape文件包括一个主文件,一个索引文件,和一个dBASE表。其中主文件的后缀就是.shp

2.shp文件的格式

百度文库详细解释

(共享程序中根目录也有此文档-shp.txt)

3.共享程序解析

(1)首先读取的时候用什么IO类(中国矢量shp数据在共享文件夹中有,有兴趣的可以打开看一下)

BinaryReader用特定的编码将基元数据类型读作二进制值。(注意:文件是已流的形式进行读取的,如果某一些字节在你程序中没有使用价值时,你也要完
全读取过去,才能保证这个文件流继续下去)
   private void ReadFile(string filePath)
{
using (var reader = new StreamReader(filePath))
{
using (var br = new BinaryReader(reader.BaseStream))
{
//读取头文件
readerHead.ReadFileHead(br); }
}
}
/// <summary>
/// 读取shp文件头类
/// </summary>
public class ReaderHead
{
// 文件长度 文件的实际长度 Integer big
public int FileLength { get; set; }
// 版本号 1000 Integer Little
public int FileBanben { get; set; }
// 几何类型 表示这个Shapefile文件所记录的空间数据的几何类型 Integer Little
public int ShapeType { get; set; }
// Xmin 空间数据所占空间范围的X方向最小值 Double Little
public double Xmin { get; set; }
// Ymax 空间数据所占空间范围的Y方向最大值 Double Little
public double Ymax { get; set; }
// Xmax 空间数据所占空间范围的X方向最大值 Double Little
public double Xmax { get; set; }
// Ymin 空间数据所占空间范围的Y方向最小值 Double Little
public double Ymin { get; set; }
// Zmin 空间数据所占空间范围的X方向最小值 Double Little
public double Zmin { get; set; }
// Zmax 空间数据所占空间范围的Y方向最大值 Double Little
public double Zmax { get; set; }
// Mmax 空间数据所占空间范围的X方向最大值 Double Little
public double Mmax { get; set; }
// Mmin 空间数据所占空间范围的Y方向最小值 Double Little
public double Mmin { get; set; }
/// <summary>
/// 读取文件头信息
/// </summary>
/// <param name="fileStream">文件流</param>
/// <returns></returns>
public void ReadFileHead(BinaryReader fileStream)
{
//读取文件过程
//去除未使用的24个字节//
//起始位置 名称 数值 类型 位序
//0 File Code 9994 Integer big
//4 Unused 0 Integer big
//8 Unused 0 Integer big
//12 Unused 0 Integer big
//16 Unused 0 Integer big
//20 Unused 0 Integer big fileStream.ReadBytes();
//24 文件长度 文件的实际长度 Integer big
int FileLength = fileStream.ReadInt32();
// //28 版本号 1000 Integer Little
//<0代表数据长度未知
int FileBanben = fileStream.ReadInt32();
//32 几何类型 表示这个Shapefile文件所记录的空间数据的几何类型 Integer Little
ShapeType = fileStream.ReadInt32();
//36 Xmin 空间数据所占空间范围的X方向最小值 Double Little
Xmin = fileStream.ReadDouble();
// 44 Ymax 空间数据所占空间范围的Y方向最大值 Double Little
Ymax = -*fileStream.ReadDouble();
// 52 Xmax 空间数据所占空间范围的X方向最大值 Double Little
Xmax = fileStream.ReadDouble();
//60 Ymin 空间数据所占空间范围的Y方向最小值 Double Little
Ymin = -*fileStream.ReadDouble();
// 68* Zmin 空间数据所占空间范围的Z方向最小值 Double Little
Zmin = fileStream.ReadDouble();
//76* Zmax 空间数据所占空间范围的Z方向最大值 Double Little
Zmax = fileStream.ReadDouble();
//84* Mmin 最小Measure值 Double Little
Mmin = fileStream.ReadDouble();
//92* Mmax 最大Measure值 Double Little
Mmax = fileStream.ReadDouble();
}

(2)根据读取的文件类型(点?线?面?)进行坐标信息的读取(继续文件流读取),

  switch (readerHead.ShapeType)
{
case (int) EnumShapeType.Point:
//清除上次打开的数据
points.Clear();
while (br.PeekChar() != -)
{
Point point = Point.ReaderPoint(br);
points.Add(point);
}
//将读取的坐标信息存入本地Txt文件当中
WriteTxtFile.WriteTxtPoint(points, shpName);
break;
case (int) EnumShapeType.PolyLine:
//清除上次打开的数据
polylines.Clear();
while (br.PeekChar() != -)
{
Polyline polyline = Polyline.ReaderPolyline(br);
polylines.Add(polyline);
}
//将读取的坐标信息存入本地Txt文件当中
WriteTxtFile.WriteTxtPolyline(polylines, shpName);
break;
case (int) EnumShapeType.Polygon:
//清除上次打开的数据
polygons.Clear();
while (br.PeekChar() != -)
{
Polygon polygon = Polygon.ReaderPolygon(br);
polygons.Add(polygon);
}
//将读取的坐标信息存入本地Txt文件当中
WriteTxtFile.WriteTxtPolygon(polygons, shpName);
break;
}
以读取线为例子(简单来说就是把很多线分为一条一条线,再分为一个一个点存储起来。)
public class Polyline//线类
{ public double[] Box { get;set;}
//表示构成当前线目标的子线段的个数
public int NumParts{ get;set;}
//表示构成当前线目标所包含的坐标点个数
public int NumPoints{ get;set;}
//文件类型
public int ShpType { get;set;}
public List<int> Parts{ get;set;} //在部分中第一个点的索引 public List<Point> Points{ get;set;} //所有部分的点 public Polyline()
{
Box = new double[];
} public static Polyline ReaderPolyline(BinaryReader br)
{
var polyline = new Polyline(); polyline.Parts = new List<int>(); polyline.Points = new List<Point>(); //实体信息的内容 记录头的内容包括记录号(Record Number)和坐标记录长度(Content Length) 两个记录项。
uint RecordNum = br.ReadUInt32();
int DataLength = br.ReadInt32();
//读取第i个记录
//几何类型
polyline.ShpType= br.ReadInt32();
//坐标范围(Box) 表示当前线目标的坐标范围 double型 32 4 Little
for (int i = ; i < ; i++)
{
polyline.Box[i] = br.ReadDouble();
}
//子线段个数(NumParts) 表示构成当前线目标的子线段的个数 int型 4 1 Little
polyline.NumParts = br.ReadInt32();
//坐标点数(NumPoints) 表示构成当前线目标所包含的坐标点个数 int型 4 1 Little
polyline.NumPoints = br.ReadInt32();
// Parts数组 记录了每个子线段的坐标在Points数组中的起始位置 int型 4×NumParts NumParts Little
for (int i = ; i < polyline.NumParts; i++)
{
var parts = new int(); parts = br.ReadInt32(); polyline.Parts.Add(parts);
}
// Points数组 记录了所有的坐标信息 Point型 根据点个数来确定 NumPoints Little
for (int j = ; j < polyline.NumPoints; j++)
{
var pointtemp = new Point(); pointtemp.X = br.ReadDouble(); pointtemp.Y = -*br.ReadDouble(); polyline.Points.Add(pointtemp);
}
return polyline;
}
}

(3)文件的可视化显示

要在窗体中绘制显示,使用using System.Drawing既GDI+绘图。绘图时的关键要找到可视范围的最大矩形,把所有数据都绘制到窗体中,我们在文件头信息

中可以看到这些信息,     Xmin Ymax Xmax Ymin ,这样我可计算出可视范围。

     double width = readerHead.Xmax - readerHead.Xmin;
double height = readerHead.Ymax - readerHead.Ymin;
showShp.ZooX = (float)(panel1.Width * 0.9 / width); //x轴放大倍数
showShp.ZooY = (float)(panel1.Height * 0.9 / height); //y轴放大倍数

在panel1_Paint中绘制图形

  private void panel1_Paint(object sender, PaintEventArgs e)
{
//显示当前文件
e.Graphics.DrawString("当前文件:" + shpName, Font, Brushes.Blue, new PointF(, )); switch (readerHead.ShapeType)
{
case (int) EnumShapeType.Point: //点类型 foreach (Point p in points)
{
//转化为float类型
PointF pp = ShowShp.ToPointF(p, readerHead.Xmin, readerHead.Ymin, showShp.ZooX, showShp.ZooY);
e.Graphics.DrawEllipse(pen, pp.X, pp.Y, 1.5f, 1.5f);
}
break;
case (int) EnumShapeType.PolyLine: //线类型
foreach (Polyline p in polylines)
{
//用于产生线
PointF[] pointFsx = ShowShp.ToPointFs(p, readerHead.Xmin, readerHead.Ymin, showShp.ZooX,
showShp.ZooY);
e.Graphics.DrawLines(pen, pointFsx);
}
break; case (int) EnumShapeType.Polygon: //面类型
//用于产生线
foreach (Polyline p in polygons)
{
PointF[] pointFsm = ShowShp.ToPointFs(p, readerHead.Xmin, readerHead.Ymin, showShp.ZooX,
showShp.ZooY);
e.Graphics.DrawLines(pen, pointFsm);
e.Graphics.FillPolygon(Brushes.Pink, pointFsm);
}
break;
}
}

(4)读取坐标信息

这个比较简单,在文件读取的时候将点数据存储进去,这里不多说,有兴趣的可以看源码,我们来看一下坐标结构,

独立的点坐标:

517336.983662845,  2860942.68850762
517445.323959293,  2860897.87513047
线坐标:
线1:
    -431977923441.66,197606922425.44,0
    -3676407859.07796,46874200203.2439,0
线2:
    -295950832655.775,-179224883130.05,0
    112130439701.878,-50550608062.3219,0
线3:
    -338229523035.172,-919101964.769489,0
    294112628726.236,13786529471.5423,0
面坐标(实际上是首尾相连的面):

多边形2:
    517494.301149368,2861056.80072212,0
    517492.347002029,2861056.61300087,0
    517491.879999161,2861058.99200249,0
    517493.744001389,2861059.31100273,0
    517494.301149368,2861056.80072212,0
多边形3:
    517496.790002823,2861099.2650013,0
    517495.791894913,2861099.20348549,0
    517495.546682358,2861103.18202782,0
    517496.544790268,2861103.24354362,0
    517496.790002823,2861099.2650013,0
多边形4:
    517512.920000076,2861099.54700279,0
    517499.350999832,2861097.9810009,0
    517499.047838211,2861100.16797829,0
    517512.573999405,2861102.04300117,0
    517512.920000076,2861099.54700279,0

(5)源码解析

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ4AAAGoCAIAAAA4lpwBAAAX20lEQVR4nO2dTWskxxmA/WNSUnbJXqwlp5APnHUgINhgrQXxxZAYFoslh0SODyEkiw5DHP8AgyE346P24It8HXLKRbA/QQizC4Yx5OCQoBzabrfq4+23qmumqrqf5kH01FRVV/fU09U9U6/6FWP2AGCUV4q3AKAJUAVABaoAqPCqEruU3w2AbeNXZa1eUAUWwrZU2Ww2w/XhMpo/9t3YbDCR0eO88S3Fmz2RLaoyPEDuSsLRV34k8scz2pLW6Xdc00HTDoL8Wcg5NR9WnR9NUJW7+/dGCakiGNJ/isKBGz2mw94gfyqjDRtuy4x1L3frmr7o7UNKEgrqm5fWO90jH6pEkyeqbFnyqyJ7InTW0DEa/bwFl7yZjdONNN3L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g3feujlfQFs3yIIFP8WZAdZv/+fmdLx7eqqDZtMqkyWko/qmTZ+mglUcVhIsWfBdmT+FuK1X295+bQCdt7UxGqql8P1a/c+ub2ImTz7myoqi31D+gp/ixIgDZgDhiAClQBUIEqACpQBUAFqgCoQBUAFagCoAJVAFSgCoAKVAFQgSoAKv4PJPRQVFJUaAcAAAAASUVORK5CYII=" alt="" />

结构应该还是挺明显的,就不多解释了,shp转WKB(OGC well-known binary)格式存入oracle,oracle连接配置文件存放在App.config下面,关于shp转WKB格式存入oracle中就不多解释是了,比较专业,如果有学GIS的同学可以参考一下。

有不懂得可以给我留言,或者有什么错误请指出,谢谢!!!

源码地址:http://pan.baidu.com/s/1boInPIR(含中国矢量地图数据)