shapefile文件结构

您所在的位置:网站首页 项条款顺序大小 shapefile文件结构

shapefile文件结构

2023-04-15 19:12| 来源: 网络整理| 查看: 265

1. shp文件 1. 文件结构 Position Field Value Type Order Byte 0 File Code 9994 Integer Big Byte 4 Unused 0 Integer Big Byte 8 Unused 0 Integer Big Byte 12 Unused 0 Integer Big Byte 16 Unused 0 Integer Big Byte 20 Unused 0 Integer Big Byte 24 File Length File Length Integer Big Byte 28 Version 1000 Integer Little Byte 32 Shape Type Shape Type Integer Little Byte 36 Bounding Box Xmin Double Little Byte 44 Bounding Box Ymin Double Little Byte 52 Bounding Box Xmax Double Little Byte 60 Bounding Box Ymax Double Little Byte 68* Bounding Box Zmin Double Little Byte 76* Bounding Box Zmax Double Little Byte 84* Bounding Box Mmin Double Little Byte 92* Bounding Box Mmax Double Little Unused, with value 0.0, if not Measured or Z type 说明:Big表示大尾(big endian)型字节顺序,即是高低位字节是反序的,主要适用于Sun® or Motorola®平台,而Little表示小尾(little endian)型字节顺序,高低位字节顺序不变,主要使用在PC or Intel®平台。在读取的字节为Big时,需要进行字节顺序交换,才能得出正确的值。

一个把Big顺序转换为Little顺序的函数可以如下:

int Big2LittleEndian(int num) { int reverse; //返回结果 char bit0, bit1, bit2, bit3; bit0 = (num & 0x000000ff); bit1 = (num & 0x0000ff00) >> 8; bit2 = (num & 0x00ff0000) >> 16; bit3 = (num & 0xff000000) >> 24; reverse = (bit0


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3