SpatiaLite  4.0.0-RC1
 All Data Structures Files Functions Variables Typedefs Macros Pages
gg_const.h
Go to the documentation of this file.
1 /*
2  gg_const.h -- Gaia common support for geometries: constants
3 
4  version 4.0, 2012 August 6
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-2012
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 generic geometry classes */
64 
66 #define GAIA_TYPE_NONE 0
67 
68 #define GAIA_TYPE_POINT 1
69 
70 #define GAIA_TYPE_LINESTRING 2
71 
72 #define GAIA_TYPE_POLYGON 3
73 
74 /* constants that defines byte storage order */
76 #define GAIA_BIG_ENDIAN 0
77 
78 #define GAIA_LITTLE_ENDIAN 1
79 
80 /* constants that defines special markers used for encoding of SpatiaLite internal BLOB geometries */
82 #define GAIA_MARK_START 0x00
83 
84 #define GAIA_MARK_END 0xFE
85 
86 #define GAIA_MARK_MBR 0x7C
87 
88 #define GAIA_MARK_ENTITY 0x69
89 
90 /* constants that defines GEOMETRY CLASSes */
92 #define GAIA_UNKNOWN 0
93 
94 #define GAIA_POINT 1
95 
96 #define GAIA_LINESTRING 2
97 
98 #define GAIA_POLYGON 3
99 
100 #define GAIA_MULTIPOINT 4
101 
102 #define GAIA_MULTILINESTRING 5
103 
104 #define GAIA_MULTIPOLYGON 6
105 #define GAIA_MULTIPOLYGON 6
106 
107 #define GAIA_GEOMETRYCOLLECTION 7
108 
109 #define GAIA_POINTZ 1001
110 
111 #define GAIA_LINESTRINGZ 1002
112 
113 #define GAIA_POLYGONZ 1003
114 
115 #define GAIA_MULTIPOINTZ 1004
116 
117 #define GAIA_MULTILINESTRINGZ 1005
118 
119 #define GAIA_MULTIPOLYGONZ 1006
120 
121 #define GAIA_GEOMETRYCOLLECTIONZ 1007
122 
123 #define GAIA_POINTM 2001
124 
125 #define GAIA_LINESTRINGM 2002
126 
127 #define GAIA_POLYGONM 2003
128 
129 #define GAIA_MULTIPOINTM 2004
130 
131 #define GAIA_MULTILINESTRINGM 2005
132 
133 #define GAIA_MULTIPOLYGONM 2006
134 
135 #define GAIA_GEOMETRYCOLLECTIONM 2007
136 
137 #define GAIA_POINTZM 3001
138 
139 #define GAIA_LINESTRINGZM 3002
140 
141 #define GAIA_POLYGONZM 3003
142 
143 #define GAIA_MULTIPOINTZM 3004
144 
145 #define GAIA_MULTILINESTRINGZM 3005
146 
147 #define GAIA_MULTIPOLYGONZM 3006
148 
149 #define GAIA_GEOMETRYCOLLECTIONZM 3007
150 
151 /* constants that defines Compressed GEOMETRY CLASSes */
153 #define GAIA_COMPRESSED_LINESTRING 1000002
154 
155 #define GAIA_COMPRESSED_POLYGON 1000003
156 
157 #define GAIA_COMPRESSED_LINESTRINGZ 1001002
158 
159 #define GAIA_COMPRESSED_POLYGONZ 1001003
160 
161 #define GAIA_COMPRESSED_LINESTRINGM 1002002
162 
163 #define GAIA_COMPRESSED_POLYGONM 1002003
164 
165 #define GAIA_COMPRESSED_LINESTRINGZM 1003002
166 
167 #define GAIA_COMPRESSED_POLYGONZM 1003003
168 
169 /* constants that defines GEOS-WKB 3D CLASSes */
171 #define GAIA_GEOSWKB_POINTZ -2147483647
172 
173 #define GAIA_GEOSWKB_LINESTRINGZ -2147483646
174 
175 #define GAIA_GEOSWKB_POLYGONZ -2147483645
176 
177 #define GAIA_GEOSWKB_MULTIPOINTZ -2147483644
178 
179 #define GAIA_GEOSWKB_MULTILINESTRINGZ -2147483643
180 
181 #define GAIA_GEOSWKB_MULTIPOLYGONZ -2147483642
182 
183 #define GAIA_GEOSWKB_GEOMETRYCOLLECTIONZ -2147483641
184 
185 /* constants that defines multitype values */
187 #define GAIA_NULL_VALUE 0
188 
189 #define GAIA_TEXT_VALUE 1
190 
191 #define GAIA_INT_VALUE 2
192 
193 #define GAIA_DOUBLE_VALUE 3
194 
195 /* constants that defines POINT index for LINESTRING */
197 #define GAIA_START_POINT 1
198 
199 #define GAIA_END_POINT 2
200 
201 #define GAIA_POINTN 3
202 
203 /* constants that defines MBRs spatial relationships */
205 #define GAIA_MBR_CONTAINS 1
206 
207 #define GAIA_MBR_DISJOINT 2
208 
209 #define GAIA_MBR_EQUAL 3
210 
211 #define GAIA_MBR_INTERSECTS 4
212 
213 #define GAIA_MBR_OVERLAPS 5
214 
215 #define GAIA_MBR_TOUCHES 6
216 
217 #define GAIA_MBR_WITHIN 7
218 
219 /* constants used for FilterMBR */
221 #define GAIA_FILTER_MBR_WITHIN 74
222 
223 #define GAIA_FILTER_MBR_CONTAINS 77
224 
225 #define GAIA_FILTER_MBR_INTERSECTS 79
226 
227 #define GAIA_FILTER_MBR_DECLARE 89
228 
229 /* constants defining SVG default values */
231 #define GAIA_SVG_DEFAULT_RELATIVE 0
232 
233 #define GAIA_SVG_DEFAULT_PRECISION 6
234 
235 #define GAIA_SVG_DEFAULT_MAX_PRECISION 15
236 
237 /* constants used for VirtualNetwork */
239 #define GAIA_NET_START 0x67
240 
241 #define GAIA_NET64_START 0x68
242 
243 #define GAIA_NET64_A_STAR_START 0x69
244 
245 #define GAIA_NET_END 0x87
246 
247 #define GAIA_NET_HEADER 0xc0
248 
249 #define GAIA_NET_CODE 0xa6
250 
251 #define GAIA_NET_ID 0xb5
252 
253 #define GAIA_NET_NODE 0xde
254 
255 #define GAIA_NET_ARC 0x54
256 
257 #define GAIA_NET_TABLE 0xa0
258 
259 #define GAIA_NET_FROM 0xa1
260 
261 #define GAIA_NET_TO 0xa2
262 
263 #define GAIA_NET_GEOM 0xa3
264 
265 #define GAIA_NET_NAME 0xa4
266 
267 #define GAIA_NET_A_STAR_COEFF 0xa5
268 
269 #define GAIA_NET_BLOCK 0xed
270 
271 /* constants used for Coordinate Dimensions */
273 #define GAIA_XY 0x00
274 
275 #define GAIA_XY_Z 0x01
276 
277 #define GAIA_XY_M 0x02
278 
279 #define GAIA_XY_Z_M 0x03
280 
281 /* constants used for length unit conversion */
283 #define GAIA_KM 0
284 
285 #define GAIA_M 1
286 
287 #define GAIA_DM 2
288 
289 #define GAIA_CM 3
290 
291 #define GAIA_MM 4
292 
293 #define GAIA_KMI 5
294 
295 #define GAIA_IN 6
296 
297 #define GAIA_FT 7
298 
299 #define GAIA_YD 8
300 
301 #define GAIA_MI 9
302 
303 #define GAIA_FATH 10
304 
305 #define GAIA_CH 11
306 
307 #define GAIA_LINK 12
308 
309 #define GAIA_US_IN 13
310 
311 #define GAIA_US_FT 14
312 
313 #define GAIA_US_YD 15
314 
315 #define GAIA_US_CH 16
316 
317 #define GAIA_US_MI 17
318 
319 #define GAIA_IND_YD 18
320 
321 #define GAIA_IND_FT 19
322 
323 #define GAIA_IND_CH 20
324 
325 #define GAIA_MIN_UNIT GAIA_KM
326 
327 #define GAIA_MAX_UNIT GAIA_IND_CH
328 
329 /* constants used for SHAPES */
331 #define GAIA_SHP_NULL 0
332 
333 #define GAIA_SHP_POINT 1
334 
335 #define GAIA_SHP_POLYLINE 3
336 
337 #define GAIA_SHP_POLYGON 5
338 
339 #define GAIA_SHP_MULTIPOINT 8
340 
341 #define GAIA_SHP_POINTZ 11
342 
343 #define GAIA_SHP_POLYLINEZ 13
344 
345 #define GAIA_SHP_POLYGONZ 15
346 
347 #define GAIA_SHP_MULTIPOINTZ 18
348 
349 #define GAIA_SHP_POINTM 21
350 
351 #define GAIA_SHP_POLYLINEM 23
352 
353 #define GAIA_SHP_POLYGONM 25
354 
355 #define GAIA_SHP_MULTIPOINTM 28
356 
357 /* constants used for Clone Special modes */
359 #define GAIA_SAME_ORDER 0
360 
361 #define GAIA_REVERSE_ORDER -1
362 
363 #define GAIA_LHR_ORDER -2
364 
365 /* macros */
379 #define gaiaGetPoint(xy,v,x,y) \
380  {*x = xy[(v) * 2]; \
381  *y = xy[(v) * 2 + 1];}
382 
396 #define gaiaSetPoint(xy,v,x,y) \
397  {xy[(v) * 2] = x; \
398  xy[(v) * 2 + 1] = y;}
399 
414 #define gaiaGetPointXYZ(xyz,v,x,y,z) \
415  {*x = xyz[(v) * 3]; \
416  *y = xyz[(v) * 3 + 1]; \
417  *z = xyz[(v) * 3 + 2];}
418 
433 #define gaiaSetPointXYZ(xyz,v,x,y,z) \
434  {xyz[(v) * 3] = x; \
435  xyz[(v) * 3 + 1] = y; \
436  xyz[(v) * 3 + 2] = z;}
437 
452 #define gaiaGetPointXYM(xym,v,x,y,m) \
453  {*x = xym[(v) * 3]; \
454  *y = xym[(v) * 3 + 1]; \
455  *m = xym[(v) * 3 + 2];}
456 
471 #define gaiaSetPointXYM(xym,v,x,y,m) \
472  {xym[(v) * 3] = x; \
473  xym[(v) * 3 + 1] = y; \
474  xym[(v) * 3 + 2] = m;}
475 
491 #define gaiaGetPointXYZM(xyzm,v,x,y,z,m) \
492  {*x = xyzm[(v) * 4]; \
493  *y = xyzm[(v) * 4 + 1]; \
494  *z = xyzm[(v) * 4 + 2]; \
495  *m = xyzm[(v) * 4 + 3];}
496 
512 #define gaiaSetPointXYZM(xyzm,v,x,y,z,m) \
513  {xyzm[(v) * 4] = x; \
514  xyzm[(v) * 4 + 1] = y; \
515  xyzm[(v) * 4 + 2] = z; \
516  xyzm[(v) * 4 + 3] = m;}
517 
518 
519 #ifdef __cplusplus
520 }
521 #endif
522 
523 #endif /* _GG_CONST_H */