SpatiaLite
3.0.0-stable
|
00001 /* 00002 gg_const.h -- Gaia common support for geometries: constants 00003 00004 version 3.0, 2011 July 20 00005 00006 Author: Sandro Furieri a.furieri@lqt.it 00007 00008 ------------------------------------------------------------------------------ 00009 00010 Version: MPL 1.1/GPL 2.0/LGPL 2.1 00011 00012 The contents of this file are subject to the Mozilla Public License Version 00013 1.1 (the "License"); you may not use this file except in compliance with 00014 the License. You may obtain a copy of the License at 00015 http://www.mozilla.org/MPL/ 00016 00017 Software distributed under the License is distributed on an "AS IS" basis, 00018 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 00019 for the specific language governing rights and limitations under the 00020 License. 00021 00022 The Original Code is the SpatiaLite library 00023 00024 The Initial Developer of the Original Code is Alessandro Furieri 00025 00026 Portions created by the Initial Developer are Copyright (C) 2008 00027 the Initial Developer. All Rights Reserved. 00028 00029 Contributor(s): 00030 Klaus Foerster klaus.foerster@svg.cc 00031 00032 Alternatively, the contents of this file may be used under the terms of 00033 either the GNU General Public License Version 2 or later (the "GPL"), or 00034 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 00035 in which case the provisions of the GPL or the LGPL are applicable instead 00036 of those above. If you wish to allow use of your version of this file only 00037 under the terms of either the GPL or the LGPL, and not to allow others to 00038 use your version of this file under the terms of the MPL, indicate your 00039 decision by deleting the provisions above and replace them with the notice 00040 and other provisions required by the GPL or the LGPL. If you do not delete 00041 the provisions above, a recipient may use your version of this file under 00042 the terms of any one of the MPL, the GPL or the LGPL. 00043 00044 */ 00045 00046 00053 #ifndef _GG_CONST_H 00054 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00055 #define _GG_CONST_H 00056 #endif 00057 00058 #ifdef __cplusplus 00059 extern "C" 00060 { 00061 #endif 00062 00063 /* constant values for generic geometry classes */ 00064 00066 #define GAIA_TYPE_NONE 0 00067 00068 #define GAIA_TYPE_POINT 1 00069 00070 #define GAIA_TYPE_LINESTRING 2 00071 00072 #define GAIA_TYPE_POLYGON 3 00073 00074 /* constants that defines byte storage order */ 00076 #define GAIA_BIG_ENDIAN 0 00077 00078 #define GAIA_LITTLE_ENDIAN 1 00079 00080 /* constants that defines special markers used for encoding of SpatiaLite internal BLOB geometries */ 00082 #define GAIA_MARK_START 0x00 00083 00084 #define GAIA_MARK_END 0xFE 00085 00086 #define GAIA_MARK_MBR 0x7C 00087 00088 #define GAIA_MARK_ENTITY 0x69 00089 00090 /* constants that defines GEOMETRY CLASSes */ 00092 #define GAIA_UNKNOWN 0 00093 00094 #define GAIA_POINT 1 00095 00096 #define GAIA_LINESTRING 2 00097 00098 #define GAIA_POLYGON 3 00099 00100 #define GAIA_MULTIPOINT 4 00101 00102 #define GAIA_MULTILINESTRING 5 00103 00104 #define GAIA_MULTIPOLYGON 6 00105 #define GAIA_MULTIPOLYGON 6 00106 00107 #define GAIA_GEOMETRYCOLLECTION 7 00108 00109 #define GAIA_POINTZ 1001 00110 00111 #define GAIA_LINESTRINGZ 1002 00112 00113 #define GAIA_POLYGONZ 1003 00114 00115 #define GAIA_MULTIPOINTZ 1004 00116 00117 #define GAIA_MULTILINESTRINGZ 1005 00118 00119 #define GAIA_MULTIPOLYGONZ 1006 00120 00121 #define GAIA_GEOMETRYCOLLECTIONZ 1007 00122 00123 #define GAIA_POINTM 2001 00124 00125 #define GAIA_LINESTRINGM 2002 00126 00127 #define GAIA_POLYGONM 2003 00128 00129 #define GAIA_MULTIPOINTM 2004 00130 00131 #define GAIA_MULTILINESTRINGM 2005 00132 00133 #define GAIA_MULTIPOLYGONM 2006 00134 00135 #define GAIA_GEOMETRYCOLLECTIONM 2007 00136 00137 #define GAIA_POINTZM 3001 00138 00139 #define GAIA_LINESTRINGZM 3002 00140 00141 #define GAIA_POLYGONZM 3003 00142 00143 #define GAIA_MULTIPOINTZM 3004 00144 00145 #define GAIA_MULTILINESTRINGZM 3005 00146 00147 #define GAIA_MULTIPOLYGONZM 3006 00148 00149 #define GAIA_GEOMETRYCOLLECTIONZM 3007 00150 00151 /* constants that defines Compressed GEOMETRY CLASSes */ 00153 #define GAIA_COMPRESSED_LINESTRING 1000002 00154 00155 #define GAIA_COMPRESSED_POLYGON 1000003 00156 00157 #define GAIA_COMPRESSED_LINESTRINGZ 1001002 00158 00159 #define GAIA_COMPRESSED_POLYGONZ 1001003 00160 00161 #define GAIA_COMPRESSED_LINESTRINGM 1002002 00162 00163 #define GAIA_COMPRESSED_POLYGONM 1002003 00164 00165 #define GAIA_COMPRESSED_LINESTRINGZM 1003002 00166 00167 #define GAIA_COMPRESSED_POLYGONZM 1003003 00168 00169 /* constants that defines GEOS-WKB 3D CLASSes */ 00171 #define GAIA_GEOSWKB_POINTZ -2147483647 00172 00173 #define GAIA_GEOSWKB_LINESTRINGZ -2147483646 00174 00175 #define GAIA_GEOSWKB_POLYGONZ -2147483645 00176 00177 #define GAIA_GEOSWKB_MULTIPOINTZ -2147483644 00178 00179 #define GAIA_GEOSWKB_MULTILINESTRINGZ -2147483643 00180 00181 #define GAIA_GEOSWKB_MULTIPOLYGONZ -2147483642 00182 00183 #define GAIA_GEOSWKB_GEOMETRYCOLLECTIONZ -2147483641 00184 00185 /* constants that defines multitype values */ 00187 #define GAIA_NULL_VALUE 0 00188 00189 #define GAIA_TEXT_VALUE 1 00190 00191 #define GAIA_INT_VALUE 2 00192 00193 #define GAIA_DOUBLE_VALUE 3 00194 00195 /* constants that defines POINT index for LINESTRING */ 00197 #define GAIA_START_POINT 1 00198 00199 #define GAIA_END_POINT 2 00200 00201 #define GAIA_POINTN 3 00202 00203 /* constants that defines MBRs spatial relationships */ 00205 #define GAIA_MBR_CONTAINS 1 00206 00207 #define GAIA_MBR_DISJOINT 2 00208 00209 #define GAIA_MBR_EQUAL 3 00210 00211 #define GAIA_MBR_INTERSECTS 4 00212 00213 #define GAIA_MBR_OVERLAPS 5 00214 00215 #define GAIA_MBR_TOUCHES 6 00216 00217 #define GAIA_MBR_WITHIN 7 00218 00219 /* constants used for FilterMBR */ 00221 #define GAIA_FILTER_MBR_WITHIN 74 00222 00223 #define GAIA_FILTER_MBR_CONTAINS 77 00224 00225 #define GAIA_FILTER_MBR_INTERSECTS 79 00226 00227 #define GAIA_FILTER_MBR_DECLARE 89 00228 00229 /* constants defining SVG default values */ 00231 #define GAIA_SVG_DEFAULT_RELATIVE 0 00232 00233 #define GAIA_SVG_DEFAULT_PRECISION 6 00234 00235 #define GAIA_SVG_DEFAULT_MAX_PRECISION 15 00236 00237 /* constants used for VirtualNetwork */ 00239 #define GAIA_NET_START 0x67 00240 00241 #define GAIA_NET64_START 0x68 00242 00243 #define GAIA_NET64_A_STAR_START 0x69 00244 00245 #define GAIA_NET_END 0x87 00246 00247 #define GAIA_NET_HEADER 0xc0 00248 00249 #define GAIA_NET_CODE 0xa6 00250 00251 #define GAIA_NET_ID 0xb5 00252 00253 #define GAIA_NET_NODE 0xde 00254 00255 #define GAIA_NET_ARC 0x54 00256 00257 #define GAIA_NET_TABLE 0xa0 00258 00259 #define GAIA_NET_FROM 0xa1 00260 00261 #define GAIA_NET_TO 0xa2 00262 00263 #define GAIA_NET_GEOM 0xa3 00264 00265 #define GAIA_NET_NAME 0xa4 00266 00267 #define GAIA_NET_A_STAR_COEFF 0xa5 00268 00269 #define GAIA_NET_BLOCK 0xed 00270 00271 /* constants used for Coordinate Dimensions */ 00273 #define GAIA_XY 0x00 00274 00275 #define GAIA_XY_Z 0x01 00276 00277 #define GAIA_XY_M 0x02 00278 00279 #define GAIA_XY_Z_M 0x03 00280 00281 /* constants used for length unit conversion */ 00283 #define GAIA_KM 0 00284 00285 #define GAIA_M 1 00286 00287 #define GAIA_DM 2 00288 00289 #define GAIA_CM 3 00290 00291 #define GAIA_MM 4 00292 00293 #define GAIA_KMI 5 00294 00295 #define GAIA_IN 6 00296 00297 #define GAIA_FT 7 00298 00299 #define GAIA_YD 8 00300 00301 #define GAIA_MI 9 00302 00303 #define GAIA_FATH 10 00304 00305 #define GAIA_CH 11 00306 00307 #define GAIA_LINK 12 00308 00309 #define GAIA_US_IN 13 00310 00311 #define GAIA_US_FT 14 00312 00313 #define GAIA_US_YD 15 00314 00315 #define GAIA_US_CH 16 00316 00317 #define GAIA_US_MI 17 00318 00319 #define GAIA_IND_YD 18 00320 00321 #define GAIA_IND_FT 19 00322 00323 #define GAIA_IND_CH 20 00324 00325 #define GAIA_MIN_UNIT GAIA_KM 00326 00327 #define GAIA_MAX_UNIT GAIA_IND_CH 00328 00329 /* constants used for SHAPES */ 00331 #define GAIA_SHP_NULL 0 00332 00333 #define GAIA_SHP_POINT 1 00334 00335 #define GAIA_SHP_POLYLINE 3 00336 00337 #define GAIA_SHP_POLYGON 5 00338 00339 #define GAIA_SHP_MULTIPOINT 8 00340 00341 #define GAIA_SHP_POINTZ 11 00342 00343 #define GAIA_SHP_POLYLINEZ 13 00344 00345 #define GAIA_SHP_POLYGONZ 15 00346 00347 #define GAIA_SHP_MULTIPOINTZ 18 00348 00349 #define GAIA_SHP_POINTM 21 00350 00351 #define GAIA_SHP_POLYLINEM 23 00352 00353 #define GAIA_SHP_POLYGONM 25 00354 00355 #define GAIA_SHP_MULTIPOINTM 28 00356 00357 /* macros */ 00371 #define gaiaGetPoint(xy,v,x,y) \ 00372 {*x = xy[(v) * 2]; \ 00373 *y = xy[(v) * 2 + 1];} 00374 00388 #define gaiaSetPoint(xy,v,x,y) \ 00389 {xy[(v) * 2] = x; \ 00390 xy[(v) * 2 + 1] = y;} 00391 00406 #define gaiaGetPointXYZ(xyz,v,x,y,z) \ 00407 {*x = xyz[(v) * 3]; \ 00408 *y = xyz[(v) * 3 + 1]; \ 00409 *z = xyz[(v) * 3 + 2];} 00410 00425 #define gaiaSetPointXYZ(xyz,v,x,y,z) \ 00426 {xyz[(v) * 3] = x; \ 00427 xyz[(v) * 3 + 1] = y; \ 00428 xyz[(v) * 3 + 2] = z;} 00429 00444 #define gaiaGetPointXYM(xym,v,x,y,m) \ 00445 {*x = xym[(v) * 3]; \ 00446 *y = xym[(v) * 3 + 1]; \ 00447 *m = xym[(v) * 3 + 2];} 00448 00463 #define gaiaSetPointXYM(xym,v,x,y,m) \ 00464 {xym[(v) * 3] = x; \ 00465 xym[(v) * 3 + 1] = y; \ 00466 xym[(v) * 3 + 2] = m;} 00467 00483 #define gaiaGetPointXYZM(xyzm,v,x,y,z,m) \ 00484 {*x = xyzm[(v) * 4]; \ 00485 *y = xyzm[(v) * 4 + 1]; \ 00486 *z = xyzm[(v) * 4 + 2]; \ 00487 *m = xyzm[(v) * 4 + 3];} 00488 00504 #define gaiaSetPointXYZM(xyzm,v,x,y,z,m) \ 00505 {xyzm[(v) * 4] = x; \ 00506 xyzm[(v) * 4 + 1] = y; \ 00507 xyzm[(v) * 4 + 2] = z; \ 00508 xyzm[(v) * 4 + 3] = m;} 00509 00510 00511 #ifdef __cplusplus 00512 } 00513 #endif 00514 00515 #endif /* _GG_CONST_H */