forked from difcareer/010templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SHPTemplate.bt
executable file
·87 lines (85 loc) · 1.64 KB
/
SHPTemplate.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//--------------------------------------
//--- 010 Editor v2.1.3 Binary Template
//
// File:
// Author:
// Revision:
// Purpose:
//--------------------------------------
typedef struct point_s {double X; double Y;} POINT;
string GetByteSize(int wordSize)
{
string s;
SPrintf(s, "%d", 2*wordSize);
return s;
}
struct ESRI_SHAPE {
SetBackColor(cLtGreen);
struct HEADER {
BigEndian();
int fileCode;
int unused[5];
int fileLength <read=GetByteSize>;
LittleEndian();
int version;
enum ShapeEnum {
NullShape,
Point,
PolyLine=3,
Polygon=5,
MultiPoint=5,
PointZ=11,
PolyLineZ=13,
PolygonZ=15} shapeType;
double Xmin;
double Ymin;
double Xmax;
double Ymax;
double Zmin;
double Zmax;
double Mmin;
double Mmax;
} header;
SetBackColor(cLtGray);
struct RECORD {
BigEndian();
int recordNumber;
int contentLength <read=GetByteSize>;
LittleEndian();
enum ShapeTypeEnum {
NullShapeType,
PointType,
PolyLineType=3,
PolygonType=5,
MultiPointType=8,
PointZType=11,
PolyLineZType=13,
PolygonZType=15,
MultiPointZType=18,
PointMType=21,
PolyLineMType=23,
PolygonMType=25,
MultiPointMType=28,
MultiPatchType=31} shapeType;
if (shapeType == 1)
{
POINT location;
}
else if (shapeType == 3)
{
double box[4];
int numParts;
int numPoints;
int parts[numParts];
POINT points[numPoints];
}
else if (shapeType == 5)
{
double box[4];
int numParts;
int numPoints;
int parts[numParts];
POINT points[numPoints];
}
} record [10000] <optimize=false>;
} esri_shape;