SpatiaLite  5.0.1
gg_core.h
Go to the documentation of this file.
1 /*
2  gg_core.h -- Gaia common support for geometries: core functions
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-2021
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_CORE_H
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 #define _GG_CORE_H
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 #if defined(_WIN32) && !defined(__MINGW32__)
64 #include <spatialite/gaiaconfig-msvc.h>
65 #else
66 #include <spatialite/gaiaconfig.h>
67 #endif
68 
69 /* constant values for gaiaGeodesicArcLength return_type */
70 
72 #define GAIA_GEODESIC_ARC_LENGTH_DEGREES 0
73 
75 #define GAIA_GEODESIC_ARC_LENGTH_METERS 1
76 
78 #define GAIA_GEODESIC_CHORD_LENGTH_DEGREES 2
79 
81 #define GAIA_GEODESIC_CHORD_LENGTH_METERS 3
82 
84 #define GAIA_GEODESIC_CENTRAL_ANGLE_RADIANS 4
85 
87 #define GAIA_GEODESIC_CENTRAL_ANGLE_DEGREES 5
88 
90 #define GAIA_GEODESIC_ARC_AREA_METERS 6
91 
93 #define GAIA_GEODESIC_ARC_HEIGHT_METERS 7
94 
95 
96 /* function prototypes */
97 
108  GAIAGEO_DECLARE void gaiaFree (void *ptr);
109 
125  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPoint (double x, double y);
126 
143  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZ (double x, double y,
144  double z);
145 
162  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYM (double x, double y,
163  double m);
164 
182  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZM (double x, double y,
183  double z, double m);
184 
196  GAIAGEO_DECLARE void gaiaFreePoint (gaiaPointPtr ptr);
197 
213  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestring (int vert);
214 
230  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZ (int vert);
231 
247  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYM (int vert);
248 
264  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZM (int vert);
265 
278  GAIAGEO_DECLARE void gaiaFreeLinestring (gaiaLinestringPtr ptr);
279 
292  GAIAGEO_DECLARE void gaiaCopyLinestringCoords (gaiaLinestringPtr dst,
293  gaiaLinestringPtr src);
294 
310  gaiaLinestringPtr src,
311  double z_no_data,
312  double m_no_data);
313 
327  dst,
329  src);
330 
346  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRing (int vert);
347 
363  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZ (int vert);
364 
380  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYM (int vert);
381 
397  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZM (int vert);
398 
411  GAIAGEO_DECLARE void gaiaFreeRing (gaiaRingPtr ptr);
412 
425  GAIAGEO_DECLARE void gaiaCopyRingCoords (gaiaRingPtr dst, gaiaRingPtr src);
426 
441  GAIAGEO_DECLARE void gaiaCopyRingCoordsEx (gaiaRingPtr dst, gaiaRingPtr src,
442  double z_no_data,
443  double m_no_data);
444 
457  GAIAGEO_DECLARE void gaiaCopyRingCoordsReverse (gaiaRingPtr dst,
458  gaiaRingPtr src);
459 
475  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygon (int vert, int holes);
476 
492  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZ (int vert, int holes);
493 
509  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYM (int vert, int holes);
510 
526  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZM (int vert, int holes);
527 
547 
563  GAIAGEO_DECLARE void gaiaFreePolygon (gaiaPolygonPtr polyg);
564 
577  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomColl (void);
578 
591  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZ (void);
592 
605  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYM (void);
606 
619  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZM (void);
620 
636  GAIAGEO_DECLARE void gaiaFreeGeomColl (gaiaGeomCollPtr geom);
637 
648  GAIAGEO_DECLARE void gaiaAddPointToGeomColl (gaiaGeomCollPtr p, double x,
649  double y);
650 
663  double x, double y,
664  double z);
665 
678  double x, double y,
679  double m);
680 
694  double x, double y,
695  double z, double m);
696 
708  GAIAGEO_DECLARE gaiaLinestringPtr
710 
722  line);
723 
737  p, int vert,
738  int interiors);
739 
754  GAIAGEO_DECLARE gaiaPolygonPtr
756 
773  int pos, int vert);
774 
788  GAIAGEO_DECLARE void gaiaInsertInteriorRing (gaiaPolygonPtr p,
789  gaiaRingPtr ring);
790 
803  GAIAGEO_DECLARE void gaiaAddRingToPolyg (gaiaPolygonPtr polyg,
804  gaiaRingPtr ring);
805 
820  line);
836  GAIAGEO_DECLARE gaiaLinestringPtr
838 
852  GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRing (gaiaRingPtr ring);
853 
870  int mode);
871 
886 
906  polyg, int mode);
907 
925 
944  geom, int mode);
945 
962  geom);
963 
978  GAIAGEO_DECLARE gaiaGeomCollPtr
980 
996  geom);
997 
1012 
1028  geom);
1029 
1044  geom);
1045 
1060  geom);
1061 
1076  geom,
1077  double
1078  no_data);
1079 
1094  geom,
1095  double
1096  no_data);
1097 
1112  GAIAGEO_DECLARE gaiaGeomCollPtr
1114  double m_no_data);
1115 
1140  GAIAGEO_DECLARE int gaiaLineGetPoint (gaiaLinestringPtr ln, int v,
1141  double *x, double *y, double *z,
1142  double *m);
1143 
1168  GAIAGEO_DECLARE int gaiaLineSetPoint (gaiaLinestringPtr ln, int v,
1169  double x, double y, double z,
1170  double m);
1171 
1196  GAIAGEO_DECLARE int gaiaRingGetPoint (gaiaRingPtr rng, int v, double *x,
1197  double *y, double *z, double *m);
1198 
1223  GAIAGEO_DECLARE int gaiaRingSetPoint (gaiaRingPtr rng, int v, double x,
1224  double y, double z, double m);
1225 
1239  GAIAGEO_DECLARE int gaiaDimension (gaiaGeomCollPtr geom);
1240 
1259  GAIAGEO_DECLARE int gaiaGeometryType (gaiaGeomCollPtr geom);
1260 
1277  GAIAGEO_DECLARE int gaiaGeometryAliasType (gaiaGeomCollPtr geom);
1278 
1289  GAIAGEO_DECLARE int gaiaIsEmpty (gaiaGeomCollPtr geom);
1290 
1303  GAIAGEO_DECLARE int gaiaCheckClockwise (gaiaGeomCollPtr geom);
1304 
1317  GAIAGEO_DECLARE int gaiaCheckCounterClockwise (gaiaGeomCollPtr geom);
1318 
1336  GAIAGEO_DECLARE int gaiaIsToxic (gaiaGeomCollPtr geom);
1337 
1356  GAIAGEO_DECLARE int gaiaIsToxic_r (const void *p_cache,
1357  gaiaGeomCollPtr geom);
1358 
1375  GAIAGEO_DECLARE int gaiaIsNotClosedRing (gaiaRingPtr ring);
1376 
1394  GAIAGEO_DECLARE int gaiaIsNotClosedRing_r (const void *p_data,
1395  gaiaRingPtr ring);
1396 
1410  GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl (gaiaGeomCollPtr geom);
1411 
1426  GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl_r (const void *p_data,
1427  gaiaGeomCollPtr geom);
1428 
1448 
1464 
1483  org,
1484  double tolerance);
1485 
1503  int force_multi);
1504 
1522 
1540 
1557  GAIAGEO_DECLARE gaiaGeomCollPtr
1559 
1576  GAIAGEO_DECLARE gaiaGeomCollPtr
1578 
1595  GAIAGEO_DECLARE gaiaGeomCollPtr
1597 
1615  geom1,
1616  gaiaGeomCollPtr geom2);
1617 
1635  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries_r (const void
1636  *p_cache,
1638  geom1,
1640  geom2);
1641 
1659  GAIAGEO_DECLARE gaiaGeomCollPtr
1660  gaiaAddMeasure (gaiaGeomCollPtr geom, double m_start, double m_end);
1661 
1662 #ifndef OMIT_GEOS /* including GEOS */
1663 
1676  GAIAGEO_DECLARE int
1677  gaiaInterpolatePoint (const void *p_cache, gaiaGeomCollPtr line,
1678  gaiaGeomCollPtr point, double *m_value);
1679 #endif /* end including GEOS */
1680 
1699  GAIAGEO_DECLARE gaiaGeomCollPtr
1701  double m_end);
1702 
1715  GAIAGEO_DECLARE int gaiaIsValidTrajectory (gaiaGeomCollPtr geom);
1716 
1736  GAIAGEO_DECLARE gaiaGeomCollPtr
1738 
1756  GAIAGEO_DECLARE double gaiaMeasureLength (int dims, double *coords,
1757  int vert);
1758 
1770  GAIAGEO_DECLARE double gaiaMeasureArea (gaiaRingPtr ring);
1771 
1783  GAIAGEO_DECLARE void gaiaRingCentroid (gaiaRingPtr ring, double *rx,
1784  double *ry);
1785 
1794  GAIAGEO_DECLARE void gaiaClockwise (gaiaRingPtr p);
1795 
1805  GAIAGEO_DECLARE int gaiaIsPointOnRingSurface (gaiaRingPtr ring,
1806  double pt_x, double pt_y);
1807 
1817  GAIAGEO_DECLARE int gaiaIsPointOnPolygonSurface (gaiaPolygonPtr polyg,
1818  double x, double y);
1819 
1835  GAIAGEO_DECLARE double gaiaMinDistance (double x0, double y0,
1836  int dims, double *coords, int vert);
1837 
1855  GAIAGEO_DECLARE int gaiaIntersect (double *x0, double *y0, double x1,
1856  double y1, double x2, double y2,
1857  double x3, double y3, double x4,
1858  double y4);
1859 
1870  GAIAGEO_DECLARE void gaiaShiftCoords (gaiaGeomCollPtr geom,
1871  double shift_x, double shift_y);
1872 
1884  GAIAGEO_DECLARE void gaiaShiftCoords3D (gaiaGeomCollPtr geom,
1885  double shift_x, double shift_y,
1886  double shift_z);
1887 
1901  GAIAGEO_DECLARE void gaiaShiftLongitude (gaiaGeomCollPtr geom);
1902 
1912  GAIAGEO_DECLARE void gaiaNormalizeLonLat (gaiaGeomCollPtr geom);
1913 
1914 
1924  GAIAGEO_DECLARE void gaiaScaleCoords (gaiaGeomCollPtr geom,
1925  double scale_x, double scale_y);
1926 
1935  GAIAGEO_DECLARE void gaiaRotateCoords (gaiaGeomCollPtr geom, double angle);
1936 
1948  GAIAGEO_DECLARE void gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axis,
1949  int y_axis);
1950 
1960  GAIAGEO_DECLARE void gaiaSwapCoords (gaiaGeomCollPtr geom);
1961 
1976  GAIAGEO_DECLARE int gaiaLinestringEquals (gaiaLinestringPtr line1,
1977  gaiaLinestringPtr line2);
1978 
1994  GAIAGEO_DECLARE int gaiaPolygonEquals (gaiaPolygonPtr polyg1,
1995  gaiaPolygonPtr polyg2);
1996 
2016  GAIAGEO_DECLARE int gaiaEllipseParams (const char *name, double *a,
2017  double *b, double *rf);
2018 
2037  GAIAGEO_DECLARE double gaiaGreatCircleDistance (double a, double b,
2038  double lat1, double lon1,
2039  double lat2, double lon2);
2040 
2060  GAIAGEO_DECLARE double gaiaGeodesicDistance (double a, double b,
2061  double rf, double lat1,
2062  double lon1, double lat2,
2063  double lon2);
2064 
2085  GAIAGEO_DECLARE double gaiaGreatCircleTotalLength (double a, double b,
2086  int dims,
2087  double *coords,
2088  int vert);
2089 
2111  GAIAGEO_DECLARE double gaiaGeodesicTotalLength (double a, double b,
2112  double rf, int dims,
2113  double *coords, int vert);
2114 
2129  GAIAGEO_DECLARE int gaiaConvertLength (double value, int unit_from,
2130  int unit_to, double *cvt);
2131 
2158  GAIAGEO_DECLARE int gaiaGeodesicArcLength (sqlite3 * sqlite,
2159  const void *cache,
2160  gaiaGeomCollPtr geom1,
2161  gaiaGeomCollPtr geom2,
2162  int return_type, double *retval);
2163 
2177  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeCircle (double center_x,
2178  double center_y,
2179  double radius, double step);
2180 
2192  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipse (double center_x,
2193  double center_y,
2194  double x_axis,
2195  double y_axis,
2196  double step);
2197 
2213  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeArc (double center_x,
2214  double center_y,
2215  double radius, double start,
2216  double stop, double step);
2217 
2231  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipticArc (double center_x,
2232  double center_y,
2233  double x_axis,
2234  double y_axis,
2235  double start,
2236  double stop,
2237  double step);
2238 
2257  gaiaGeomCollPtr interiors);
2258 
2269  GAIAGEO_DECLARE double gaiaCurvosityIndex (const void *p_cache,
2270  gaiaLinestringPtr line,
2271  int extra_points);
2272 
2283  GAIAGEO_DECLARE void gaiaUpDownHeight (gaiaLinestringPtr line, double *up,
2284  double *down);
2285 
2286 #ifdef _WIN32
2287  GAIAGEO_DECLARE FILE * gaia_win_fopen(const char *path, const char *mode);
2288 #endif
2289 
2290 #ifdef __cplusplus
2291 }
2292 #endif
2293 
2294 #endif /* _GG_CORE_H */
gaiaTrajectoryInterpolatePoint
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTrajectoryInterpolatePoint(gaiaGeomCollPtr geom, double m)
Attempts to interpolate a Point along a Trajectory accordingly to given M-Value.
gaiaAllocRingXYM
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYM(int vert)
Allocates 2D RING [XYM].
gaiaExtractLinestringsFromGeomColl
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractLinestringsFromGeomColl(gaiaGeomCollPtr geom)
Extracts any Linestring from a Geometry object.
gaiaScaleCoords
GAIAGEO_DECLARE void gaiaScaleCoords(gaiaGeomCollPtr geom, double scale_x, double scale_y)
Scales any coordinate within a Geometry object.
gaiaIsNotClosedGeomColl
GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl(gaiaGeomCollPtr geom)
Checks for not-closed Rings in a Geometry object.
gaiaGeometryAliasType
GAIAGEO_DECLARE int gaiaGeometryAliasType(gaiaGeomCollPtr geom)
Determines the corresponding Type for a Geometry object.
gaiaIsPointOnPolygonSurface
GAIAGEO_DECLARE int gaiaIsPointOnPolygonSurface(gaiaPolygonPtr polyg, double x, double y)
Checks if a Point lays on a Polygon surface.
gaiaCopyLinestringCoords
GAIAGEO_DECLARE void gaiaCopyLinestringCoords(gaiaLinestringPtr dst, gaiaLinestringPtr src)
Copies coordinates between two LINESTRING objects.
gaiaCloneLinestring
GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestring(gaiaLinestringPtr line)
Duplicates a Linestring object.
gaiaCastGeomCollToXYZnoData
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZnoData(gaiaGeomCollPtr geom, double no_data)
Duplicates a Geometry object [casting dimensions to 3D XYZ - noData].
gaiaFreeGeomColl
GAIAGEO_DECLARE void gaiaFreeGeomColl(gaiaGeomCollPtr geom)
Destroys a Geometry object.
gaiaPolygonStruct
Container for OGC POLYGON Geometry.
Definition: gg_structs.h:193
gaiaCloneRingSpecial
GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRingSpecial(gaiaRingPtr ring, int mode)
Duplicates a Ring object (special)
gaiaGeometryType
GAIAGEO_DECLARE int gaiaGeometryType(gaiaGeomCollPtr geom)
Determines the corresponding Type for a Geometry object.
gaiaAllocPointXYZ
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZ(double x, double y, double z)
Allocates a 3D POINT [XYZ].
gaiaInterpolatePoint
GAIAGEO_DECLARE int gaiaInterpolatePoint(const void *p_cache, gaiaGeomCollPtr line, gaiaGeomCollPtr point, double *m_value)
Will interpolate the M-value for a LinestringM at the point closest to the given Point.
gaiaPolygonEquals
GAIAGEO_DECLARE int gaiaPolygonEquals(gaiaPolygonPtr polyg1, gaiaPolygonPtr polyg2)
Checks if two Polygons objects are equivalent.
gaiaCastGeomCollToXYZMnoData
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZMnoData(gaiaGeomCollPtr geom, double z_no_data, double m_no_data)
Duplicates a Geometry object [casting dimensions to 3D XYZM - noData].
gaiaAllocGeomCollXYZM
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZM(void)
Allocates a 3D Geometry [XYZM].
gaiaAllocGeomColl
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomColl(void)
Allocates a 2D Geometry [XY].
gaiaClonePolygon
GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygon(gaiaPolygonPtr polyg)
Duplicates a Polygon object.
gaiaAllocLinestringXYZM
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZM(int vert)
Allocates a 3D LINESTRING [XYZM].
gaiaExtractPointsFromGeomColl
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractPointsFromGeomColl(gaiaGeomCollPtr geom)
Extracts any Point from a Geometry object.
gaiaCopyLinestringCoordsReverse
GAIAGEO_DECLARE void gaiaCopyLinestringCoordsReverse(gaiaLinestringPtr dst, gaiaLinestringPtr src)
Copies coordinates between two LINESTRING objects in reverse order.
gaiaMergeGeometries
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries(gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
Merges two Geometry objects into a single one.
gaiaFreeLinestring
GAIAGEO_DECLARE void gaiaFreeLinestring(gaiaLinestringPtr ptr)
Destroys a LINESTRING object.
gaiaAllocRingXYZM
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZM(int vert)
Allocates a 3D RING [XYZM].
gaiaFree
GAIAGEO_DECLARE void gaiaFree(void *ptr)
Safely frees any dynamic memory block allocated by the library itself.
gaiaGeodesicArcLength
GAIAGEO_DECLARE int gaiaGeodesicArcLength(sqlite3 *sqlite, const void *cache, gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2, int return_type, double *retval)
Computes several Geodesic values based on the Distance between two Geometries.
gaiaEllipseParams
GAIAGEO_DECLARE int gaiaEllipseParams(const char *name, double *a, double *b, double *rf)
Retrieves Geodesic params for an Ellipsoid definition.
gaiaAllocPointXYZM
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZM(double x, double y, double z, double m)
Allocates a 3D POINT [XYZM].
gaiaAllocPointXYM
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYM(double x, double y, double m)
Allocates a 2D POINT [XYM].
gaiaCurvosityIndex
GAIAGEO_DECLARE double gaiaCurvosityIndex(const void *p_cache, gaiaLinestringPtr line, int extra_points)
Computes the Curvosity Index for some Linestrings.
gaiaInsertPolygonInGeomColl
GAIAGEO_DECLARE gaiaPolygonPtr gaiaInsertPolygonInGeomColl(gaiaGeomCollPtr p, gaiaRingPtr ring)
Creates a new Polygon object into a Geometry object starting from an already existing Ring object.
gaiaFreePolygon
GAIAGEO_DECLARE void gaiaFreePolygon(gaiaPolygonPtr polyg)
Destroys a POLYGON object.
gaiaMergeGeometries_r
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries_r(const void *p_cache, gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
Merges two Geometry objects into a single one.
gaiaAddPointToGeomCollXYM
GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYM(gaiaGeomCollPtr p, double x, double y, double m)
Creates a new 2D Point [XYM] object into a Geometry object.
gaiaMakeEllipticArc
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipticArc(double center_x, double center_y, double x_axis, double y_axis, double start, double stop, double step)
Creates an Elliptic Arc (Linestring) Geometry.
gaiaRotateCoords
GAIAGEO_DECLARE void gaiaRotateCoords(gaiaGeomCollPtr geom, double angle)
Rotates any coordinate within a Geometry object.
gaiaCloneGeomColl
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomColl(gaiaGeomCollPtr geom)
Duplicates a Geometry object.
gaiaLinestringEquals
GAIAGEO_DECLARE int gaiaLinestringEquals(gaiaLinestringPtr line1, gaiaLinestringPtr line2)
Checks if two Linestring objects are equivalent.
gaiaCopyRingCoords
GAIAGEO_DECLARE void gaiaCopyRingCoords(gaiaRingPtr dst, gaiaRingPtr src)
Copies coordinates between two RING objects.
gaiaGeodesicDistance
GAIAGEO_DECLARE double gaiaGeodesicDistance(double a, double b, double rf, double lat1, double lon1, double lat2, double lon2)
Calculates the Geodesic Distance between two Points.
gaiaCopyRingCoordsReverse
GAIAGEO_DECLARE void gaiaCopyRingCoordsReverse(gaiaRingPtr dst, gaiaRingPtr src)
Copies coordinates between two RING objects in reverse order.
gaiaCastGeomCollToXYZM
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZM(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 3D XYZM].
gaiaCopyRingCoordsEx
GAIAGEO_DECLARE void gaiaCopyRingCoordsEx(gaiaRingPtr dst, gaiaRingPtr src, double z_no_data, double m_no_data)
Copies coordinates between two RING objects.
gaiaAddPointToGeomColl
GAIAGEO_DECLARE void gaiaAddPointToGeomColl(gaiaGeomCollPtr p, double x, double y)
Creates a new 2D Point [XY] object into a Geometry object.
gaiaIntersect
GAIAGEO_DECLARE int gaiaIntersect(double *x0, double *y0, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Determines the intesection Point between two Segments.
gaiaAddPolygonToGeomColl
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAddPolygonToGeomColl(gaiaGeomCollPtr p, int vert, int interiors)
Creates a new Polygon object into a Geometry object.
gaiaMakePolygon
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakePolygon(gaiaGeomCollPtr exterior, gaiaGeomCollPtr interiors)
Creates a Polygon from closed Linestrings.
gaiaShiftCoords3D
GAIAGEO_DECLARE void gaiaShiftCoords3D(gaiaGeomCollPtr geom, double shift_x, double shift_y, double shift_z)
Shifts any coordinate within a 3D Geometry object.
gaiaMakeArc
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeArc(double center_x, double center_y, double radius, double start, double stop, double step)
Creates a Circular Arc (Linestring) Geometry.
gaiaIsToxic
GAIAGEO_DECLARE int gaiaIsToxic(gaiaGeomCollPtr geom)
Checks for toxic Geometry object.
gaiaCastGeomCollToXYZ
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZ(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 3D XYZ].
gaiaLineSetPoint
GAIAGEO_DECLARE int gaiaLineSetPoint(gaiaLinestringPtr ln, int v, double x, double y, double z, double m)
Sets coordinates for a Linestring's Point.
gaiaAllocPoint
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPoint(double x, double y)
Allocates a 2D POINT [XY].
gaiaRingSetPoint
GAIAGEO_DECLARE int gaiaRingSetPoint(gaiaRingPtr rng, int v, double x, double y, double z, double m)
Sets coodinates for a Ring's Point.
gaiaMeasureArea
GAIAGEO_DECLARE double gaiaMeasureArea(gaiaRingPtr ring)
Measures the geometric area for a Ring object.
gaiaLinearize
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLinearize(gaiaGeomCollPtr geom, int force_multi)
Attempts to resolve a (Multi)Linestring from a Geometry object.
gaiaAllocLinestringXYM
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYM(int vert)
Allocates a 2D LINESTRING [XYM].
gaiaUpDownHeight
GAIAGEO_DECLARE void gaiaUpDownHeight(gaiaLinestringPtr line, double *up, double *down)
Computes the Uphill and Downhill total Height for some 3D Linestrings.
gaiaCloneGeomCollLinestrings
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollLinestrings(gaiaGeomCollPtr geom)
Duplicates a Geometry object [Linestrings only].
gaiaMakeCircle
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeCircle(double center_x, double center_y, double radius, double step)
Creates a Circle (Linestring) Geometry.
gaiaPointStruct
Container for OGC POINT Geometry.
Definition: gg_structs.h:79
gaiaAddMeasure
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAddMeasure(gaiaGeomCollPtr geom, double m_start, double m_end)
Will return a new GEOMETRY (supporting M) with measures linearly interpolated between the start and e...
gaiaRingGetPoint
GAIAGEO_DECLARE int gaiaRingGetPoint(gaiaRingPtr rng, int v, double *x, double *y, double *z, double *m)
Gets coordinates from a Ring's Point.
gaiaDimension
GAIAGEO_DECLARE int gaiaDimension(gaiaGeomCollPtr geom)
Determines OGC dimensions for a Geometry object.
gaiaIsNotClosedGeomColl_r
GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl_r(const void *p_data, gaiaGeomCollPtr geom)
Checks for not-closed Rings in a Geometry object.
gaiaIsNotClosedRing
GAIAGEO_DECLARE int gaiaIsNotClosedRing(gaiaRingPtr ring)
Checks for not-closed Rings.
gaiaSanitize
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSanitize(gaiaGeomCollPtr org)
Attempts to sanitize a possibly malformed Geometry object.
gaiaCastGeomCollToXYMnoData
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYMnoData(gaiaGeomCollPtr geom, double no_data)
Duplicates a Geometry object [casting dimensions to 2D XYM - noData].
gaiaCreatePolygon
GAIAGEO_DECLARE gaiaPolygonPtr gaiaCreatePolygon(gaiaRingPtr ring)
Allocates a POLYGON.
gaiaIsPointOnRingSurface
GAIAGEO_DECLARE int gaiaIsPointOnRingSurface(gaiaRingPtr ring, double pt_x, double pt_y)
Check if a Point lays on a Ring surface.
gaiaIsNotClosedRing_r
GAIAGEO_DECLARE int gaiaIsNotClosedRing_r(const void *p_data, gaiaRingPtr ring)
Checks for not-closed Rings.
gaiaAllocRing
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRing(int vert)
Allocates a 2D RING [XY].
gaiaAddPointToGeomCollXYZ
GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZ(gaiaGeomCollPtr p, double x, double y, double z)
Creates a new 3D Point [XYZ] object into a Geometry object.
gaiaLocateBetweenMeasures
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLocateBetweenMeasures(gaiaGeomCollPtr geom, double m_start, double m_end)
Return a GeometryCollection containing elements matching the specified range of measures.
gaiaCloneGeomCollPolygons
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollPolygons(gaiaGeomCollPtr geom)
Duplicates a Geometry object [Polygons only].
gaiaRingStruct
Container for OGC RING Geometry.
Definition: gg_structs.h:159
gaiaAllocLinestringXYZ
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZ(int vert)
Allocates a 3D LINESTRING [XYZ].
gaiaCastGeomCollToXYM
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYM(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 2D XYM].
gaiaIsValidTrajectory
GAIAGEO_DECLARE int gaiaIsValidTrajectory(gaiaGeomCollPtr geom)
Checks if a Geometry object is valid Trajectory.
gaiaClonePolygonSpecial
GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygonSpecial(gaiaPolygonPtr polyg, int mode)
Duplicates a Polygon object (special)
gaiaLinestringStruct
Container for OGC LINESTRING Geometry.
Definition: gg_structs.h:129
gaiaMinDistance
GAIAGEO_DECLARE double gaiaMinDistance(double x0, double y0, int dims, double *coords, int vert)
Computes the minimum distance between a Point and a Linestring or Ring.
gaiaAllocGeomCollXYZ
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZ(void)
Allocates a 3D Geometry [XYZ].
gaiaGeodesicTotalLength
GAIAGEO_DECLARE double gaiaGeodesicTotalLength(double a, double b, double rf, int dims, double *coords, int vert)
Calculates the Geodesic Total Length for a Linestring / Ring.
gaiaReflectCoords
GAIAGEO_DECLARE void gaiaReflectCoords(gaiaGeomCollPtr geom, int x_axis, int y_axis)
Reflects any coordinate within a Geometry object.
gaiaRingCentroid
GAIAGEO_DECLARE void gaiaRingCentroid(gaiaRingPtr ring, double *rx, double *ry)
Determines the Centroid for a Ring object.
gaiaAllocPolygonXYM
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYM(int vert, int holes)
Allocates a 2D POLYGON [XYM].
gaiaCheckClockwise
GAIAGEO_DECLARE int gaiaCheckClockwise(gaiaGeomCollPtr geom)
Checks for Clockwise Geometry object.
gaiaGreatCircleTotalLength
GAIAGEO_DECLARE double gaiaGreatCircleTotalLength(double a, double b, int dims, double *coords, int vert)
Calculates the Great Circle Total Length for a Linestring / Ring.
gaiaCopyLinestringCoordsEx
GAIAGEO_DECLARE void gaiaCopyLinestringCoordsEx(gaiaLinestringPtr dst, gaiaLinestringPtr src, double z_no_data, double m_no_data)
Copies coordinates between two LINESTRING objects.
gaiaAddInteriorRing
GAIAGEO_DECLARE gaiaRingPtr gaiaAddInteriorRing(gaiaPolygonPtr p, int pos, int vert)
Creates a new Interior Ring object into a Polygon object.
gaiaCloneRing
GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRing(gaiaRingPtr ring)
Duplicates a Ring object.
gaiaInsertInteriorRing
GAIAGEO_DECLARE void gaiaInsertInteriorRing(gaiaPolygonPtr p, gaiaRingPtr ring)
Inserts an already existing Ring object into a Polygon object.
gaiaFreeRing
GAIAGEO_DECLARE void gaiaFreeRing(gaiaRingPtr ptr)
Destroys a RING object.
gaiaCloneGeomCollSpecial
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollSpecial(gaiaGeomCollPtr geom, int mode)
Duplicates a Geometry object (special)
gaiaGreatCircleDistance
GAIAGEO_DECLARE double gaiaGreatCircleDistance(double a, double b, double lat1, double lon1, double lat2, double lon2)
Calculates the Great Circle Distance between between two Points.
gaiaShiftCoords
GAIAGEO_DECLARE void gaiaShiftCoords(gaiaGeomCollPtr geom, double shift_x, double shift_y)
Shifts any coordinate within a Geometry object.
gaiaEnsureClosedRings
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaEnsureClosedRings(gaiaGeomCollPtr org)
Attempts to sanitize a possibly malformed Geometry object.
gaiaAllocPolygonXYZM
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZM(int vert, int holes)
Allocates a 3D POLYGON [XYZM].
gaiaInsertLinestringInGeomColl
GAIAGEO_DECLARE void gaiaInsertLinestringInGeomColl(gaiaGeomCollPtr p, gaiaLinestringPtr line)
Inserts an already existing Linestring object into a Geometry object.
gaiaGeomCollStruct
Container for OGC GEOMETRYCOLLECTION Geometry.
Definition: gg_structs.h:227
gaiaIsEmpty
GAIAGEO_DECLARE int gaiaIsEmpty(gaiaGeomCollPtr geom)
Checks for empty Geometry object.
gaiaAllocPolygonXYZ
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZ(int vert, int holes)
Allocates a 3D POLYGON [XYZ].
gaiaAllocGeomCollXYM
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYM(void)
Allocates a 2D Geometry [XYM].
gaiaShiftLongitude
GAIAGEO_DECLARE void gaiaShiftLongitude(gaiaGeomCollPtr geom)
Shifts negative longitudes.
gaiaCheckCounterClockwise
GAIAGEO_DECLARE int gaiaCheckCounterClockwise(gaiaGeomCollPtr geom)
Checks for CounterClockwise Geometry object.
gaiaCloneLinestringSpecial
GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestringSpecial(gaiaLinestringPtr line, int mode)
Duplicates a Linestring object (special)
gaiaFreePoint
GAIAGEO_DECLARE void gaiaFreePoint(gaiaPointPtr ptr)
Destroys a POINT object.
gaiaAddPointToGeomCollXYZM
GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZM(gaiaGeomCollPtr p, double x, double y, double z, double m)
Creates a new 3D Point [XYZM] object into a Geometry object.
gaiaIsToxic_r
GAIAGEO_DECLARE int gaiaIsToxic_r(const void *p_cache, gaiaGeomCollPtr geom)
Checks for toxic Geometry object.
gaiaCastGeomCollToXY
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXY(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 2D XY].
gaiaClockwise
GAIAGEO_DECLARE void gaiaClockwise(gaiaRingPtr p)
Determines the direction for a Ring object.
gaiaCloneGeomCollPoints
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollPoints(gaiaGeomCollPtr geom)
Duplicates a Geometry object [Points only].
gaiaDissolveSegments
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolveSegments(gaiaGeomCollPtr geom)
Attempts to resolve a collection of Segments from a Geometry object.
gaiaSwapCoords
GAIAGEO_DECLARE void gaiaSwapCoords(gaiaGeomCollPtr geom)
Swaps any coordinate within a Geometry object.
gaiaAllocRingXYZ
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZ(int vert)
Allocates a 3D RING [XYZ].
gaiaExtractPolygonsFromGeomColl
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractPolygonsFromGeomColl(gaiaGeomCollPtr geom)
Extracts any Polygon from a Geometry object.
gaiaRemoveRepeatedPoints
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaRemoveRepeatedPoints(gaiaGeomCollPtr org, double tolerance)
Attempts to sanitize a possibly malformed Geometry object.
gaiaAddLinestringToGeomColl
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAddLinestringToGeomColl(gaiaGeomCollPtr p, int vert)
Creates a new Linestring object into a Geometry object.
gaiaConvertLength
GAIAGEO_DECLARE int gaiaConvertLength(double value, int unit_from, int unit_to, double *cvt)
Convert a Length from a Measure Unit to another.
gaiaAddRingToPolyg
GAIAGEO_DECLARE void gaiaAddRingToPolyg(gaiaPolygonPtr polyg, gaiaRingPtr ring)
Inserts an already existing Ring object into a Polygon object.
gaiaAllocLinestring
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestring(int vert)
Allocates a 2D LINESTRING [XY].
gaiaNormalizeLonLat
GAIAGEO_DECLARE void gaiaNormalizeLonLat(gaiaGeomCollPtr geom)
Shifts any coordinate to within the "normal range" of longitude and latitude values (-180....
gaiaLineGetPoint
GAIAGEO_DECLARE int gaiaLineGetPoint(gaiaLinestringPtr ln, int v, double *x, double *y, double *z, double *m)
Gets coodinates from a Linestring's Point.
gaiaAllocPolygon
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygon(int vert, int holes)
Allocates a 2D POLYGON [XY].
gaiaMeasureLength
GAIAGEO_DECLARE double gaiaMeasureLength(int dims, double *coords, int vert)
Measures the geometric length for a Linestring or Ring.
gaiaMakeEllipse
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipse(double center_x, double center_y, double x_axis, double y_axis, double step)
Creates an Ellipse (Linestring) Geometry.
gaiaDissolvePoints
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolvePoints(gaiaGeomCollPtr geom)
Attempts to resolve a collection of Points from a Geometry object.