GIS开源库shapeLib的使用方法(一)

    近期研究了一下GIS开源库shapeLib读写ArcGIS数据的API函数,先整理一下,将各个API的用法介绍一下。

分为两个模块,shape API和DBF API,前者的读取.shp文件的空间几何信息,后者读取.dbf文件的属性信息。

Shape API:

Shape Types (shape类型)

shape文件的类型定义如下:

#define SHPT_NULL             0

  2D Shape Types (pre ArcView 3.x):

  #define SHPT_POINT		1	Points
  #define SHPT_ARC		3	Arcs (Polylines, possible in parts)
  #define SHPT_POLYGON		5	Polygons (possible in parts)
  #define SHPT_MULTIPOINT	8	MultiPoint (related points)

  3D Shape Types (may include "measure" values for vertices):

  #define SHPT_POINTZ		11	
  #define SHPT_ARCZ		13
  #define SHPT_POLYGONZ		15
  #define SHPT_MULTIPOINTZ 	18

  2D + Measure Types:

  #define SHPT_POINTM		21
  #define SHPT_ARCM		23
  #define SHPT_POLYGONM		25
  #define SHPT_MULTIPOINTM 	28

  Complex (TIN-like) with Z, and Measure:

  #define SHPT_MULTIPATCH 	31
 

SHPObject  (shape文件中包含的要素对象)

typedef struct
  {
    int		nSHPType;	//Shape Type (SHPT_* - see list above) 要素类型

    int		nShapeId; 	//Shape Number (-1 is unknown/unassigned) ID

    int		nParts;		//# of Parts (0 implies single part with no info) 要素有几个部分组成
    int		*panPartStart;  //Start Vertex of part 要素部分的起始点
    int		*panPartType;	//Part Type (SHPP_RING if not SHPT_MULTIPATCH) 各个部分的类型
    
    int		nVertices;	//Vertex list 
    double	*padfX;		
    double	*padfY;
    double	*padfZ;		//(all zero if not 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值