1
/******************************************************************************
5
* Purpose: Generate sample .VCT files
6
* Author: Even Rouault, <even dot rouault at mines dash paris dot org>
8
******************************************************************************
9
* Copyright (c) 2011, Even Rouault <even dot rouault at mines dash paris dot org>
11
* Permission is hereby granted, free of charge, to any person obtaining a
12
* copy of this software and associated documentation files (the "Software"),
13
* to deal in the Software without restriction, including without limitation
14
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
* and/or sell copies of the Software, and to permit persons to whom the
16
* Software is furnished to do so, subject to the following conditions:
18
* The above copyright notice and this permission notice shall be included
19
* in all copies or substantial portions of the Software.
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
* DEALINGS IN THE SOFTWARE.
28
****************************************************************************/
32
int main(int argc, char* argv[])
41
double minx, maxx, miny, maxy;
43
f = fopen("points.vct", "wb");
47
fwrite(&nfeatures, 1, sizeof(int), f);
57
fwrite(&id, 1, sizeof(double), f);
58
fwrite(&x, 1, sizeof(double), f);
59
fwrite(&y, 1, sizeof(double), f);
64
fwrite(&id, 1, sizeof(double), f);
65
fwrite(&x, 1, sizeof(double), f);
66
fwrite(&y, 1, sizeof(double), f);
72
f = fopen("lines.vct", "wb");
76
fwrite(&nfeatures, 1, sizeof(int), f);
88
fwrite(&id, 1, sizeof(double), f);
89
fwrite(&minx, 1, sizeof(double), f);
90
fwrite(&miny, 1, sizeof(double), f);
91
fwrite(&maxx, 1, sizeof(double), f);
92
fwrite(&maxy, 1, sizeof(double), f);
94
fwrite(&nodes, 1, sizeof(int), f);
97
fwrite(&x, 1, sizeof(double), f);
98
fwrite(&y, 1, sizeof(double), f);
101
fwrite(&x, 1, sizeof(double), f);
102
fwrite(&y, 1, sizeof(double), f);
109
fwrite(&id, 1, sizeof(double), f);
110
fwrite(&minx, 1, sizeof(double), f);
111
fwrite(&miny, 1, sizeof(double), f);
112
fwrite(&maxx, 1, sizeof(double), f);
113
fwrite(&maxy, 1, sizeof(double), f);
115
fwrite(&nodes, 1, sizeof(int), f);
118
fwrite(&x, 1, sizeof(double), f);
119
fwrite(&y, 1, sizeof(double), f);
122
fwrite(&x, 1, sizeof(double), f);
123
fwrite(&y, 1, sizeof(double), f);
129
f = fopen("polygons.vct", "wb");
133
fwrite(&nfeatures, 1, sizeof(int), f);
145
fwrite(&id, 1, sizeof(double), f);
146
fwrite(&minx, 1, sizeof(double), f);
147
fwrite(&miny, 1, sizeof(double), f);
148
fwrite(&maxx, 1, sizeof(double), f);
149
fwrite(&maxy, 1, sizeof(double), f);
151
fwrite(&nparts, 1, sizeof(int), f);
153
fwrite(&nodes, 1, sizeof(int), f);
156
fwrite(&nodes, 1, sizeof(int), f);
159
fwrite(&x, 1, sizeof(double), f);
160
fwrite(&y, 1, sizeof(double), f);
163
fwrite(&x, 1, sizeof(double), f);
164
fwrite(&y, 1, sizeof(double), f);
167
fwrite(&x, 1, sizeof(double), f);
168
fwrite(&y, 1, sizeof(double), f);
171
fwrite(&x, 1, sizeof(double), f);
172
fwrite(&y, 1, sizeof(double), f);
175
fwrite(&x, 1, sizeof(double), f);
176
fwrite(&y, 1, sizeof(double), f);
180
fwrite(&nodes, 1, sizeof(int), f);
183
fwrite(&x, 1, sizeof(double), f);
184
fwrite(&y, 1, sizeof(double), f);
187
fwrite(&x, 1, sizeof(double), f);
188
fwrite(&y, 1, sizeof(double), f);
191
fwrite(&x, 1, sizeof(double), f);
192
fwrite(&y, 1, sizeof(double), f);
195
fwrite(&x, 1, sizeof(double), f);
196
fwrite(&y, 1, sizeof(double), f);
199
fwrite(&x, 1, sizeof(double), f);
200
fwrite(&y, 1, sizeof(double), f);