SpatiaLite  4.0.0-RC1
 All Data Structures Files Functions Variables Typedefs Macros Pages
gg_advanced.h
Go to the documentation of this file.
1 /*
2  gg_advanced.h -- Gaia common support for geometries: advanced
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 
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_ADVANCED_H
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 #define _GG_ADVANCED_H
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 #ifndef OMIT_PROJ /* including PROJ.4 */
64 
75  GAIAGEO_DECLARE double gaiaRadsToDegs (double rads);
76 
87  GAIAGEO_DECLARE double gaiaDegsToRads (double degs);
88 
106  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTransform (gaiaGeomCollPtr org,
107  char *proj_from,
108  char *proj_to);
109 
110 #endif /* end including PROJ.4 */
111 
112 #ifndef OMIT_GEOS /* including GEOS */
113 
122  GAIAGEO_DECLARE void gaiaResetGeosMsg (void);
123 
135  GAIAGEO_DECLARE const char *gaiaGetGeosErrorMsg (void);
136 
148  GAIAGEO_DECLARE const char *gaiaGetGeosWarningMsg (void);
149 
160  GAIAGEO_DECLARE void gaiaSetGeosErrorMsg (const char *msg);
161 
172  GAIAGEO_DECLARE void gaiaSetGeosWarningMsg (const char *msg);
173 
185  GAIAGEO_DECLARE void *gaiaToGeos (const gaiaGeomCollPtr gaia);
186 
201  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XY (const void *geos);
202 
217  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZ (const void *geos);
218 
233  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYM (const void *geos);
234 
249  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZM (const void *geos);
250 
262  GAIAGEO_DECLARE int gaiaIsSimple (gaiaGeomCollPtr geom);
263 
279  GAIAGEO_DECLARE int gaiaIsClosed (gaiaLinestringPtr line);
280 
292  GAIAGEO_DECLARE int gaiaIsClosedGeom (gaiaGeomCollPtr geom);
293 
305  GAIAGEO_DECLARE int gaiaIsRing (gaiaLinestringPtr line);
306 
318  GAIAGEO_DECLARE int gaiaIsValid (gaiaGeomCollPtr geom);
319 
332  GAIAGEO_DECLARE int gaiaGeomCollLength (gaiaGeomCollPtr geom,
333  double *length);
346  GAIAGEO_DECLARE int gaiaGeomCollArea (gaiaGeomCollPtr geom, double *area);
347 
348 
366  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaPolygonize (gaiaGeomCollPtr geom,
367  int force_multi);
382  GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1,
383  gaiaGeomCollPtr geom2);
384 
399  GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1,
400  gaiaGeomCollPtr geom2);
401 
416  GAIAGEO_DECLARE int gaiaGeomCollIntersects (gaiaGeomCollPtr geom1,
417  gaiaGeomCollPtr geom2);
418 
433  GAIAGEO_DECLARE int gaiaGeomCollOverlaps (gaiaGeomCollPtr geom1,
434  gaiaGeomCollPtr geom2);
435 
450  GAIAGEO_DECLARE int gaiaGeomCollCrosses (gaiaGeomCollPtr geom1,
451  gaiaGeomCollPtr geom2);
452 
467  GAIAGEO_DECLARE int gaiaGeomCollContains (gaiaGeomCollPtr geom1,
468  gaiaGeomCollPtr geom2);
469 
484  GAIAGEO_DECLARE int gaiaGeomCollWithin (gaiaGeomCollPtr geom1,
485  gaiaGeomCollPtr geom2);
486 
501  GAIAGEO_DECLARE int gaiaGeomCollTouches (gaiaGeomCollPtr geom1,
502  gaiaGeomCollPtr geom2);
503 
519  GAIAGEO_DECLARE int gaiaGeomCollRelate (gaiaGeomCollPtr geom1,
520  gaiaGeomCollPtr geom2,
521  const char *pattern);
522 
534  GAIAGEO_DECLARE int gaiaGeomCollDistance (gaiaGeomCollPtr geom1,
535  gaiaGeomCollPtr geom2,
536  double *dist);
537 
556  geom1,
558  geom2);
559 
576  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeometryUnion (gaiaGeomCollPtr geom1,
577  gaiaGeomCollPtr geom2);
578 
596  geom1,
598  geom2);
599 
617  geom1,
619  geom2);
620 
636  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaBoundary (gaiaGeomCollPtr geom);
637 
651  GAIAGEO_DECLARE int gaiaGeomCollCentroid (gaiaGeomCollPtr geom, double *x,
652  double *y);
653 
665  GAIAGEO_DECLARE int gaiaGetPointOnSurface (gaiaGeomCollPtr geom, double *x,
666  double *y);
667 
685  double tolerance);
686 
703  GAIAGEO_DECLARE gaiaGeomCollPtr
705  double tolerance);
706 
722  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConvexHull (gaiaGeomCollPtr geom);
723 
742  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollBuffer (gaiaGeomCollPtr geom,
743  double radius,
744  int points);
745 
746 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
747 #ifdef GEOS_ADVANCED
748 #endif
749 
762  GAIAGEO_DECLARE int gaiaHausdorffDistance (gaiaGeomCollPtr geom1,
763  gaiaGeomCollPtr geom2,
764  double *dist);
765 
786  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaOffsetCurve (gaiaGeomCollPtr geom,
787  double radius, int points,
788  int left_right);
789 
811  double radius,
812  int points,
813  int left_right);
814 
831  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSharedPaths (gaiaGeomCollPtr geom1,
832  gaiaGeomCollPtr geom2);
833 
853  ln_geom,
854  double fraction);
855 
876  GAIAGEO_DECLARE gaiaGeomCollPtr
878  double distance);
879 
900  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineSubstring (gaiaGeomCollPtr ln_geom,
901  double start_fraction,
902  double end_fraction);
903 
922  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaShortestLine (gaiaGeomCollPtr geom1,
923  gaiaGeomCollPtr geom2);
924 
943  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSnap (gaiaGeomCollPtr geom1,
944  gaiaGeomCollPtr geom2,
945  double tolerance);
946 
962  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLineMerge (gaiaGeomCollPtr geom);
963 
981  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLinesCutAtNodes (gaiaGeomCollPtr geom1,
982  gaiaGeomCollPtr geom2);
983 
1001  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaUnaryUnion (gaiaGeomCollPtr geom);
1002 
1016  GAIAGEO_DECLARE double gaiaLineLocatePoint (gaiaGeomCollPtr ln_geom,
1017  gaiaGeomCollPtr pt_geom);
1018 
1031  GAIAGEO_DECLARE int gaiaGeomCollCovers (gaiaGeomCollPtr geom1,
1032  gaiaGeomCollPtr geom2);
1033 
1047  GAIAGEO_DECLARE int gaiaGeomCollCoveredBy (gaiaGeomCollPtr geom1,
1048  gaiaGeomCollPtr geom2);
1049 
1050 #endif /* end GEOS advanced features */
1051 
1052 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1053 #ifdef GEOS_TRUNK
1054 #endif
1055 
1075  geom,
1076  double tolerance,
1077  int only_edges);
1078 
1098  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaVoronojDiagram (gaiaGeomCollPtr geom,
1099  double extra_frame_size,
1100  double tolerance,
1101  int only_edges);
1102 
1130  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConcaveHull (gaiaGeomCollPtr geom,
1131  double factor,
1132  double tolerance,
1133  int allow_holes);
1134 
1135 #endif /* end GEOS experimental features */
1136 
1137 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1138 #ifdef ENABLE_LWGEOM
1139 #endif
1140 
1159  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeValid (gaiaGeomCollPtr geom);
1160 
1181  geom);
1182 
1202  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSegmentize (gaiaGeomCollPtr geom,
1203  double dist);
1204 
1220  GAIAGEO_DECLARE int gaiaAzimuth (double xa, double ya, double xb,
1221  double yb, double *azimuth);
1222 
1241  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplit (gaiaGeomCollPtr input,
1242  gaiaGeomCollPtr blade);
1243 
1263  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitLeft (gaiaGeomCollPtr input,
1264  gaiaGeomCollPtr blade);
1265 
1285  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSplitRight (gaiaGeomCollPtr input,
1286  gaiaGeomCollPtr blade);
1287 
1288 
1289 #endif /* end LWGEOM support */
1290 
1291 #endif /* end including GEOS */
1292 
1318  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSnapToGrid (gaiaGeomCollPtr geom,
1319  double origin_x,
1320  double origin_y,
1321  double origin_z,
1322  double origin_m,
1323  double size_x,
1324  double size_y,
1325  double size_z,
1326  double size_m);
1327 
1348  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSquareGrid (gaiaGeomCollPtr geom,
1349  double origin_x,
1350  double origin_y,
1351  double size,
1352  int only_edges);
1353 
1374  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTriangularGrid (gaiaGeomCollPtr geom,
1375  double origin_x,
1376  double origin_y,
1377  double size,
1378  int only_edges);
1379 
1400  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaHexagonalGrid (gaiaGeomCollPtr geom,
1401  double origin_x,
1402  double origin_y,
1403  double size,
1404  int only_edges);
1405 
1406 #ifdef __cplusplus
1407 }
1408 #endif
1409 
1410 #endif /* _GG_ADVANCED_H */