SpatiaLite  5.0.0
gg_const.h
Go to the documentation of this file.
1 /*
2  gg_const.h -- Gaia common support for geometries: constants
3 
4  version 5.0, 2020 August 1
5 
6  Author: Sandro Furieri a.furieri@lqt.it
7 
8  ------------------------------------------------------------------------------
9 
10  Version: MPL 1.1/GPL 2.0/LGPL 2.1
11 
12  The contents of this file are subject to the Mozilla Public License Version
13  1.1 (the "License"); you may not use this file except in compliance with
14  the License. You may obtain a copy of the License at
15  http://www.mozilla.org/MPL/
16 
17 Software distributed under the License is distributed on an "AS IS" basis,
18 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 for the specific language governing rights and limitations under the
20 License.
21 
22 The Original Code is the SpatiaLite library
23 
24 The Initial Developer of the Original Code is Alessandro Furieri
25 
26 Portions created by the Initial Developer are Copyright (C) 2008-2020
27 the Initial Developer. All Rights Reserved.
28 
29 Contributor(s):
30 Klaus Foerster klaus.foerster@svg.cc
31 
32 Alternatively, the contents of this file may be used under the terms of
33 either the GNU General Public License Version 2 or later (the "GPL"), or
34 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
35 in which case the provisions of the GPL or the LGPL are applicable instead
36 of those above. If you wish to allow use of your version of this file only
37 under the terms of either the GPL or the LGPL, and not to allow others to
38 use your version of this file under the terms of the MPL, indicate your
39 decision by deleting the provisions above and replace them with the notice
40 and other provisions required by the GPL or the LGPL. If you do not delete
41 the provisions above, a recipient may use your version of this file under
42 the terms of any one of the MPL, the GPL or the LGPL.
43 
44 */
45 
46 
53 #ifndef _GG_CONST_H
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 #define _GG_CONST_H
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 /* constant values for getVectorLayersList modes */
64 
66 #define GAIA_VECTORS_LIST_FAST 0
67 
69 #define GAIA_VECTORS_LIST_OPTIMISTIC 1
70 
72 #define GAIA_VECTORS_LIST_PESSIMISTIC 2
73 
74 /* constant values for Vector Layer Types */
75 
77 #define GAIA_VECTOR_UNKNOWN -1
78 
79 #define GAIA_VECTOR_TABLE 1
80 
81 #define GAIA_VECTOR_VIEW 2
82 
83 #define GAIA_VECTOR_VIRTUAL 3
84 
85 /* constant values for Vector Layer Geometry Types */
86 
88 #define GAIA_VECTOR_GEOMETRY 0
89 
90 #define GAIA_VECTOR_POINT 1
91 
92 #define GAIA_VECTOR_LINESTRING 2
93 
94 #define GAIA_VECTOR_POLYGON 3
95 
96 #define GAIA_VECTOR_MULTIPOINT 4
97 
98 #define GAIA_VECTOR_MULTILINESTRING 5
99 
100 #define GAIA_VECTOR_MULTIPOLYGON 6
101 
102 #define GAIA_VECTOR_GEOMETRYCOLLECTION 7
103 
104 /* constant values for Spatial Index */
105 
107 #define GAIA_SPATIAL_INDEX_NONE 0
108 
109 #define GAIA_SPATIAL_INDEX_RTREE 1
110 
111 #define GAIA_SPATIAL_INDEX_MBRCACHE 2
112 
113 /* constant values for generic geometry classes */
114 
116 #define GAIA_TYPE_NONE 0
117 
118 #define GAIA_TYPE_POINT 1
119 
120 #define GAIA_TYPE_LINESTRING 2
121 
122 #define GAIA_TYPE_POLYGON 3
123 
124 /* constants that defines byte storage order */
126 #define GAIA_BIG_ENDIAN 0
127 
128 #define GAIA_LITTLE_ENDIAN 1
129 
130 #define GAIA_TINYPOINT_BIG_ENDIAN 0x80
131 
132 #define GAIA_TINYPOINT_LITTLE_ENDIAN 0x81
133 
134 /* constants that defines special markers used for encoding of SpatiaLite internal BLOB geometries */
136 #define GAIA_MARK_START 0x00
137 
138 #define GAIA_MARK_END 0xFE
139 
140 #define GAIA_MARK_MBR 0x7C
141 
142 #define GAIA_MARK_ENTITY 0x69
143 
144 /* constants that defines GEOMETRY CLASSes */
146 #define GAIA_UNKNOWN 0
147 
148 #define GAIA_POINT 1
149 
150 #define GAIA_LINESTRING 2
151 
152 #define GAIA_POLYGON 3
153 
154 #define GAIA_MULTIPOINT 4
155 
156 #define GAIA_MULTILINESTRING 5
157 
158 #define GAIA_MULTIPOLYGON 6
159 
160 #define GAIA_GEOMETRYCOLLECTION 7
161 
162 #define GAIA_POINTZ 1001
163 
164 #define GAIA_LINESTRINGZ 1002
165 
166 #define GAIA_POLYGONZ 1003
167 
168 #define GAIA_MULTIPOINTZ 1004
169 
170 #define GAIA_MULTILINESTRINGZ 1005
171 
172 #define GAIA_MULTIPOLYGONZ 1006
173 
174 #define GAIA_GEOMETRYCOLLECTIONZ 1007
175 
176 #define GAIA_POINTM 2001
177 
178 #define GAIA_LINESTRINGM 2002
179 
180 #define GAIA_POLYGONM 2003
181 
182 #define GAIA_MULTIPOINTM 2004
183 
184 #define GAIA_MULTILINESTRINGM 2005
185 
186 #define GAIA_MULTIPOLYGONM 2006
187 
188 #define GAIA_GEOMETRYCOLLECTIONM 2007
189 
190 #define GAIA_POINTZM 3001
191 
192 #define GAIA_LINESTRINGZM 3002
193 
194 #define GAIA_POLYGONZM 3003
195 
196 #define GAIA_MULTIPOINTZM 3004
197 
198 #define GAIA_MULTILINESTRINGZM 3005
199 
200 #define GAIA_MULTIPOLYGONZM 3006
201 
202 #define GAIA_GEOMETRYCOLLECTIONZM 3007
203 
204 /* constants that defines TinyPoint Types */
206 #define GAIA_TINYPOINT_XY 0x01
207 
208 #define GAIA_TINYPOINT_XYZ 0x02
209 
210 #define GAIA_TINYPOINT_XYM 0x03
211 
212 #define GAIA_TINYPOINT_XYZM 0x04
213 
214 /* constants that defines Compressed GEOMETRY CLASSes */
216 #define GAIA_COMPRESSED_LINESTRING 1000002
217 
218 #define GAIA_COMPRESSED_POLYGON 1000003
219 
220 #define GAIA_COMPRESSED_LINESTRINGZ 1001002
221 
222 #define GAIA_COMPRESSED_POLYGONZ 1001003
223 
224 #define GAIA_COMPRESSED_LINESTRINGM 1002002
225 
226 #define GAIA_COMPRESSED_POLYGONM 1002003
227 
228 #define GAIA_COMPRESSED_LINESTRINGZM 1003002
229 
230 #define GAIA_COMPRESSED_POLYGONZM 1003003
231 
232 /* constants that defines GEOS-WKB 3D CLASSes */
234 #define GAIA_GEOSWKB_POINTZ -2147483647
235 
236 #define GAIA_GEOSWKB_LINESTRINGZ -2147483646
237 
238 #define GAIA_GEOSWKB_POLYGONZ -2147483645
239 
240 #define GAIA_GEOSWKB_MULTIPOINTZ -2147483644
241 
242 #define GAIA_GEOSWKB_MULTILINESTRINGZ -2147483643
243 
244 #define GAIA_GEOSWKB_MULTIPOLYGONZ -2147483642
245 
246 #define GAIA_GEOSWKB_GEOMETRYCOLLECTIONZ -2147483641
247 
248 /* constants that defines multitype values */
250 #define GAIA_NULL_VALUE 0
251 
252 #define GAIA_TEXT_VALUE 1
253 
254 #define GAIA_INT_VALUE 2
255 
256 #define GAIA_DOUBLE_VALUE 3
257 
258 /* constants that defines POINT index for LINESTRING */
260 #define GAIA_START_POINT 1
261 
262 #define GAIA_END_POINT 2
263 
264 #define GAIA_POINTN 3
265 
266 /* constants that defines MBRs spatial relationships */
268 #define GAIA_MBR_CONTAINS 1
269 
270 #define GAIA_MBR_DISJOINT 2
271 
272 #define GAIA_MBR_EQUAL 3
273 
274 #define GAIA_MBR_INTERSECTS 4
275 
276 #define GAIA_MBR_OVERLAPS 5
277 
278 #define GAIA_MBR_TOUCHES 6
279 
280 #define GAIA_MBR_WITHIN 7
281 
282 /* constants used for FilterMBR */
284 #define GAIA_FILTER_MBR_WITHIN 74
285 
286 #define GAIA_FILTER_MBR_CONTAINS 77
287 
288 #define GAIA_FILTER_MBR_INTERSECTS 79
289 
290 #define GAIA_FILTER_MBR_DECLARE 89
291 
292 /* constants defining SVG default values */
294 #define GAIA_SVG_DEFAULT_RELATIVE 0
295 
296 #define GAIA_SVG_DEFAULT_PRECISION 6
297 
298 #define GAIA_SVG_DEFAULT_MAX_PRECISION 15
299 
300 /* constants used for VirtualNetwork */
302 #define GAIA_NET_START 0x67
303 
304 #define GAIA_NET64_START 0x68
305 
306 #define GAIA_NET64_A_STAR_START 0x69
307 
308 #define GAIA_NET_END 0x87
309 
310 #define GAIA_NET_HEADER 0xc0
311 
312 #define GAIA_NET_CODE 0xa6
313 
314 #define GAIA_NET_ID 0xb5
315 
316 #define GAIA_NET_NODE 0xde
317 
318 #define GAIA_NET_ARC 0x54
319 
320 #define GAIA_NET_TABLE 0xa0
321 
322 #define GAIA_NET_FROM 0xa1
323 
324 #define GAIA_NET_TO 0xa2
325 
326 #define GAIA_NET_GEOM 0xa3
327 
328 #define GAIA_NET_NAME 0xa4
329 
330 #define GAIA_NET_A_STAR_COEFF 0xa5
331 
332 #define GAIA_NET_BLOCK 0xed
333 
334 /* constants used for Coordinate Dimensions */
336 #define GAIA_XY 0x00
337 
338 #define GAIA_XY_Z 0x01
339 
340 #define GAIA_XY_M 0x02
341 
342 #define GAIA_XY_Z_M 0x03
343 
344 /* constants used for length unit conversion */
346 #define GAIA_KM 0
347 
348 #define GAIA_M 1
349 
350 #define GAIA_DM 2
351 
352 #define GAIA_CM 3
353 
354 #define GAIA_MM 4
355 
356 #define GAIA_KMI 5
357 
358 #define GAIA_IN 6
359 
360 #define GAIA_FT 7
361 
362 #define GAIA_YD 8
363 
364 #define GAIA_MI 9
365 
366 #define GAIA_FATH 10
367 
368 #define GAIA_CH 11
369 
370 #define GAIA_LINK 12
371 
372 #define GAIA_US_IN 13
373 
374 #define GAIA_US_FT 14
375 
376 #define GAIA_US_YD 15
377 
378 #define GAIA_US_CH 16
379 
380 #define GAIA_US_MI 17
381 
382 #define GAIA_IND_YD 18
383 
384 #define GAIA_IND_FT 19
385 
386 #define GAIA_IND_CH 20
387 
388 #define GAIA_MIN_UNIT GAIA_KM
389 
390 #define GAIA_MAX_UNIT GAIA_IND_CH
391 
392 /* constants used for SHAPES */
394 #define GAIA_SHP_NULL 0
395 
396 #define GAIA_SHP_POINT 1
397 
398 #define GAIA_SHP_POLYLINE 3
399 
400 #define GAIA_SHP_POLYGON 5
401 
402 #define GAIA_SHP_MULTIPOINT 8
403 
404 #define GAIA_SHP_POINTZ 11
405 
406 #define GAIA_SHP_POLYLINEZ 13
407 
408 #define GAIA_SHP_POLYGONZ 15
409 
410 #define GAIA_SHP_MULTIPOINTZ 18
411 
412 #define GAIA_SHP_POINTM 21
413 
414 #define GAIA_SHP_POLYLINEM 23
415 
416 #define GAIA_SHP_POLYGONM 25
417 
418 #define GAIA_SHP_MULTIPOINTM 28
419 
420 /* constants used for Clone Special modes */
422 #define GAIA_SAME_ORDER 0
423 
424 #define GAIA_REVERSE_ORDER -1
425 
426 #define GAIA_CW_ORDER -2
427 
428 #define GAIA_CCW_ORDER -3
429 
430 /* constants used for DBF column-names case */
432 #define GAIA_DBF_COLNAME_CASE_IGNORE 0
433 
434 #define GAIA_DBF_COLNAME_LOWERCASE 1
435 
436 #define GAIA_DBF_COLNAME_UPPERCASE 2
437 
438 /* constants used for PROJ.6 WKT styles */
440 #define GAIA_PROJ_WKT_ISO_2018 1
441 
442 #define GAIA_PROJ_WKT_ISO_2015 2
443 
444 #define GAIA_PROJ_WKT_GDAL 3
445 
446 #define GAIA_PROJ_WKT_ESRI 4
447 
448 /* macros */
462 #define gaiaGetPoint(xy,v,x,y) \
463  {*x = xy[(v) * 2]; \
464  *y = xy[(v) * 2 + 1];}
465 
479 #define gaiaSetPoint(xy,v,x,y) \
480  {xy[(v) * 2] = x; \
481  xy[(v) * 2 + 1] = y;}
482 
497 #define gaiaGetPointXYZ(xyz,v,x,y,z) \
498  {*x = xyz[(v) * 3]; \
499  *y = xyz[(v) * 3 + 1]; \
500  *z = xyz[(v) * 3 + 2];}
501 
516 #define gaiaSetPointXYZ(xyz,v,x,y,z) \
517  {xyz[(v) * 3] = x; \
518  xyz[(v) * 3 + 1] = y; \
519  xyz[(v) * 3 + 2] = z;}
520 
535 #define gaiaGetPointXYM(xym,v,x,y,m) \
536  {*x = xym[(v) * 3]; \
537  *y = xym[(v) * 3 + 1]; \
538  *m = xym[(v) * 3 + 2];}
539 
554 #define gaiaSetPointXYM(xym,v,x,y,m) \
555  {xym[(v) * 3] = x; \
556  xym[(v) * 3 + 1] = y; \
557  xym[(v) * 3 + 2] = m;}
558 
574 #define gaiaGetPointXYZM(xyzm,v,x,y,z,m) \
575  {*x = xyzm[(v) * 4]; \
576  *y = xyzm[(v) * 4 + 1]; \
577  *z = xyzm[(v) * 4 + 2]; \
578  *m = xyzm[(v) * 4 + 3];}
579 
595 #define gaiaSetPointXYZM(xyzm,v,x,y,z,m) \
596  {xyzm[(v) * 4] = x; \
597  xyzm[(v) * 4 + 1] = y; \
598  xyzm[(v) * 4 + 2] = z; \
599  xyzm[(v) * 4 + 3] = m;}
600 
601 
602 #ifdef __cplusplus
603 }
604 #endif
605 
606 #endif /* _GG_CONST_H */