|
1 | 1 | /* |
2 | | - * Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com) |
| 2 | + * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
13 | 13 | * See the License for the specific language governing permissions and |
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | | -#ifndef __BASICS_H__ |
17 | | -#define __BASICS_H__ |
| 16 | +#ifndef __INTERNAL_DATA_H__ |
| 17 | +#define __INTERNAL_DATA_H__ |
18 | 18 |
|
19 | 19 |
|
20 | 20 | // *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** |
21 | 21 |
|
22 | 22 | #define mapcode_dataversion "2.3.0" // coords 2.0.2 |
23 | 23 |
|
24 | | -#define MAPCODE_NR_TERRITORIES 533 // nr of territories in this database |
25 | | - |
26 | | -static const char *iso3166alpha[MAPCODE_NR_TERRITORIES] = { |
| 24 | +static const char *iso3166alpha[_TERRITORY_MAX - _TERRITORY_MIN - 1] = { |
27 | 25 | "VAT", "MCO", "GIB", "TKL", "CCK", "BLM", "NRU", "TUV", "MAC", "SXM", |
28 | 26 | "MAF", "NFK", "PCN", "BVT", "BMU", "IOT", "SMR", "GGY", "AIA", "MSR", |
29 | 27 | "JEY", "CXR", "WLF", "VGB", "LIE", "ABW", "MHL", "ASM", "COK", "SPM", |
@@ -111,33 +109,8 @@ static const char *iso3166alpha[MAPCODE_NR_TERRITORIES] = { |
111 | 109 | }; |
112 | 110 |
|
113 | 111 |
|
114 | | -#define parents3 "USA,IND,CAN,AUS,MEX,BRA,RUS,CHN," |
115 | | -#define parents2 "US,IN,CA,AU,MX,BR,RU,CN," |
116 | | - |
117 | | -// 360 * cos(microdegrees>>19) |
118 | | -static const int xdivider19[172] = { |
119 | | - 360, 360, 360, 360, 360, 360, 361, 361, 361, 361, |
120 | | - 362, 362, 362, 363, 363, 363, 364, 364, 365, 366, |
121 | | - 366, 367, 367, 368, 369, 370, 370, 371, 372, 373, |
122 | | - 374, 375, 376, 377, 378, 379, 380, 382, 383, 384, |
123 | | - 386, 387, 388, 390, 391, 393, 394, 396, 398, 399, |
124 | | - 401, 403, 405, 407, 409, 411, 413, 415, 417, 420, |
125 | | - 422, 424, 427, 429, 432, 435, 437, 440, 443, 446, |
126 | | - 449, 452, 455, 459, 462, 465, 469, 473, 476, 480, |
127 | | - 484, 488, 492, 496, 501, 505, 510, 515, 520, 525, |
128 | | - 530, 535, 540, 546, 552, 558, 564, 570, 577, 583, |
129 | | - 590, 598, 605, 612, 620, 628, 637, 645, 654, 664, |
130 | | - 673, 683, 693, 704, 715, 726, 738, 751, 763, 777, |
131 | | - 791, 805, 820, 836, 852, 869, 887, 906, 925, 946, |
132 | | - 968, 990, 1014, 1039, 1066, 1094, 1123, 1154, 1187, 1223, |
133 | | - 1260, 1300, 1343, 1389, 1438, 1490, 1547, 1609, 1676, 1749, |
134 | | - 1828, 1916, 2012, 2118, 2237, 2370, 2521, 2691, 2887, 3114, |
135 | | - 3380, 3696, 4077, 4547, 5139, 5910, 6952, 8443, 10747, 14784, |
136 | | - 23681, 59485 |
137 | | -}; |
138 | | - |
139 | 112 | // index of first rectangle record for x-th territory |
140 | | -static const int data_start[MAPCODE_NR_TERRITORIES + 1] = { |
| 113 | +static const int data_start[_TERRITORY_MAX - _TERRITORY_MIN] = { |
141 | 114 | 0, 3, 6, 10, 14, 17, 19, 20, 31, 32, |
142 | 115 | 34, 36, 38, 43, 45, 48, 52, 59, 63, 65, |
143 | 116 | 67, 71, 73, 81, 87, 95, 97, 132, 139, 149, |
@@ -194,18 +167,18 @@ static const int data_start[MAPCODE_NR_TERRITORIES + 1] = { |
194 | 167 | 16320, 16322, 16324, 16356 |
195 | 168 | }; |
196 | 169 |
|
197 | | -#define MAPCODE_NR_RECS 16356 |
| 170 | +#define MAPCODE_BOUNDARY_MAX 16356 |
198 | 171 |
|
199 | 172 | typedef struct { |
200 | 173 | int minx; |
201 | 174 | int miny; |
202 | 175 | int maxx; |
203 | 176 | int maxy; |
204 | 177 | int flags; |
205 | | -} mminforec; |
| 178 | +} TerritoryBoundary; |
206 | 179 |
|
207 | 180 | #ifndef MAKE_SOURCE_DIGITAL |
208 | | -static const mminforec mminfo[MAPCODE_NR_RECS + 1] = { |
| 181 | +static const TerritoryBoundary territoryBoundaries[MAPCODE_BOUNDARY_MAX + 1] = { |
209 | 182 | {12433114, 41851944, 12548434, 41938434, 0x001000b}, // VAT |
210 | 183 | {5850000, 35450000, 18560000, 55080000, 0x50a0216}, |
211 | 184 | {12444000, 41899000, 12460000, 41908000, 0x003021c}, |
@@ -16563,7 +16536,10 @@ static const mminforec mminfo[MAPCODE_NR_RECS + 1] = { |
16563 | 16536 | {-180000000, 77183669, 180000000, 90000001, 0x001f097}, |
16564 | 16537 | {-180000000, -90000000, 180000000, 90000001, 0x000001d}, |
16565 | 16538 | }; |
| 16539 | + |
| 16540 | +#define territoryBoundary(m) (&territoryBoundaries[m]) |
| 16541 | + |
16566 | 16542 | #endif // MAKE_SOURCE_DIGITAL |
16567 | 16543 |
|
16568 | | -#endif // __BASICS_H__ |
| 16544 | +#endif // __INTERNAL_DATA_H__ |
16569 | 16545 |
|
0 commit comments