SpatiaLite  4.2.0
 All Data Structures Files Functions Variables Typedefs Macros Pages
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 4.2, 2014 July 25
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-2013
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 /* function prototypes */
64 
75  GAIAGEO_DECLARE void gaiaFree (void *ptr);
76 
92  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPoint (double x, double y);
93 
110  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZ (double x, double y,
111  double z);
112 
129  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYM (double x, double y,
130  double m);
131 
149  GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZM (double x, double y,
150  double z, double m);
151 
163  GAIAGEO_DECLARE void gaiaFreePoint (gaiaPointPtr ptr);
164 
180  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestring (int vert);
181 
197  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZ (int vert);
198 
214  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYM (int vert);
215 
231  GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZM (int vert);
232 
245  GAIAGEO_DECLARE void gaiaFreeLinestring (gaiaLinestringPtr ptr);
246 
259  GAIAGEO_DECLARE void gaiaCopyLinestringCoords (gaiaLinestringPtr dst,
260  gaiaLinestringPtr src);
261 
274  GAIAGEO_DECLARE void gaiaCopyLinestringCoordsReverse (gaiaLinestringPtr dst,
276  src);
277 
293  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRing (int vert);
294 
310  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZ (int vert);
311 
327  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYM (int vert);
328 
344  GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZM (int vert);
345 
358  GAIAGEO_DECLARE void gaiaFreeRing (gaiaRingPtr ptr);
359 
372  GAIAGEO_DECLARE void gaiaCopyRingCoords (gaiaRingPtr dst, gaiaRingPtr src);
373 
386  GAIAGEO_DECLARE void gaiaCopyRingCoordsReverse (gaiaRingPtr dst,
387  gaiaRingPtr src);
388 
404  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygon (int vert, int holes);
405 
421  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZ (int vert, int holes);
422 
438  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYM (int vert, int holes);
439 
455  GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZM (int vert, int holes);
456 
475  GAIAGEO_DECLARE gaiaPolygonPtr gaiaCreatePolygon (gaiaRingPtr ring);
476 
492  GAIAGEO_DECLARE void gaiaFreePolygon (gaiaPolygonPtr polyg);
493 
506  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomColl (void);
507 
520  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZ (void);
521 
534  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYM (void);
535 
548  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZM (void);
549 
565  GAIAGEO_DECLARE void gaiaFreeGeomColl (gaiaGeomCollPtr geom);
566 
577  GAIAGEO_DECLARE void gaiaAddPointToGeomColl (gaiaGeomCollPtr p, double x,
578  double y);
579 
591  GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZ (gaiaGeomCollPtr p, double x,
592  double y, double z);
593 
605  GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYM (gaiaGeomCollPtr p, double x,
606  double y, double m);
607 
620  GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZM (gaiaGeomCollPtr p,
621  double x, double y,
622  double z, double m);
623 
635  GAIAGEO_DECLARE gaiaLinestringPtr
637 
647  GAIAGEO_DECLARE void gaiaInsertLinestringInGeomColl (gaiaGeomCollPtr p,
649  line);
650 
664  int vert,
665  int interiors);
666 
682  p,
684  ring);
685 
701  GAIAGEO_DECLARE gaiaRingPtr gaiaAddInteriorRing (gaiaPolygonPtr p, int pos,
702  int vert);
703 
717  GAIAGEO_DECLARE void gaiaInsertInteriorRing (gaiaPolygonPtr p,
718  gaiaRingPtr ring);
719 
732  GAIAGEO_DECLARE void gaiaAddRingToPolyg (gaiaPolygonPtr polyg,
733  gaiaRingPtr ring);
734 
749  line);
765  GAIAGEO_DECLARE gaiaLinestringPtr
767 
781  GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRing (gaiaRingPtr ring);
782 
798  GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRingSpecial (gaiaRingPtr ring,
799  int mode);
800 
814  GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygon (gaiaPolygonPtr polyg);
815 
833  polyg, int mode);
834 
851  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomColl (gaiaGeomCollPtr geom);
852 
871  geom, int mode);
872 
889  geom);
890 
905  GAIAGEO_DECLARE gaiaGeomCollPtr
907 
923  geom);
924 
939 
954  geom);
955 
970  geom);
971 
986  geom);
987 
1012  GAIAGEO_DECLARE int gaiaLineGetPoint (gaiaLinestringPtr ln, int v,
1013  double *x, double *y, double *z,
1014  double *m);
1015 
1040  GAIAGEO_DECLARE int gaiaLineSetPoint (gaiaLinestringPtr ln, int v, double x,
1041  double y, double z, double m);
1042 
1067  GAIAGEO_DECLARE int gaiaRingGetPoint (gaiaRingPtr rng, int v, double *x,
1068  double *y, double *z, double *m);
1069 
1094  GAIAGEO_DECLARE int gaiaRingSetPoint (gaiaRingPtr rng, int v, double x,
1095  double y, double z, double m);
1096 
1110  GAIAGEO_DECLARE int gaiaDimension (gaiaGeomCollPtr geom);
1111 
1130  GAIAGEO_DECLARE int gaiaGeometryType (gaiaGeomCollPtr geom);
1131 
1148  GAIAGEO_DECLARE int gaiaGeometryAliasType (gaiaGeomCollPtr geom);
1149 
1160  GAIAGEO_DECLARE int gaiaIsEmpty (gaiaGeomCollPtr geom);
1161 
1179  GAIAGEO_DECLARE int gaiaIsToxic (gaiaGeomCollPtr geom);
1180 
1199  GAIAGEO_DECLARE int gaiaIsToxic_r (const void *p_cache,
1200  gaiaGeomCollPtr geom);
1201 
1218  GAIAGEO_DECLARE int gaiaIsNotClosedRing (gaiaRingPtr ring);
1219 
1237  GAIAGEO_DECLARE int gaiaIsNotClosedRing_r (const void *p_data,
1238  gaiaRingPtr ring);
1239 
1253  GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl (gaiaGeomCollPtr geom);
1254 
1269  GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl_r (const void *p_data,
1270  gaiaGeomCollPtr geom);
1271 
1290  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSanitize (gaiaGeomCollPtr org);
1291 
1292 
1309  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLinearize (gaiaGeomCollPtr geom,
1310  int force_multi);
1311 
1328  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolveSegments (gaiaGeomCollPtr geom);
1329 
1346  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolvePoints (gaiaGeomCollPtr geom);
1347 
1364  GAIAGEO_DECLARE gaiaGeomCollPtr
1366 
1383  GAIAGEO_DECLARE gaiaGeomCollPtr
1385 
1402  GAIAGEO_DECLARE gaiaGeomCollPtr
1404 
1421  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries (gaiaGeomCollPtr geom1,
1422  gaiaGeomCollPtr geom2);
1423 
1441  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries_r (const void *p_cache,
1443  geom1,
1445  geom2);
1446 
1465  GAIAGEO_DECLARE gaiaGeomCollPtr
1466  gaiaLocateBetweenMeasures (gaiaGeomCollPtr geom, double m_start,
1467  double m_end);
1468 
1486  GAIAGEO_DECLARE double gaiaMeasureLength (int dims, double *coords,
1487  int vert);
1488 
1500  GAIAGEO_DECLARE double gaiaMeasureArea (gaiaRingPtr ring);
1501 
1513  GAIAGEO_DECLARE void gaiaRingCentroid (gaiaRingPtr ring, double *rx,
1514  double *ry);
1515 
1524  GAIAGEO_DECLARE void gaiaClockwise (gaiaRingPtr p);
1525 
1535  GAIAGEO_DECLARE int gaiaIsPointOnRingSurface (gaiaRingPtr ring, double pt_x,
1536  double pt_y);
1537 
1547  GAIAGEO_DECLARE int gaiaIsPointOnPolygonSurface (gaiaPolygonPtr polyg,
1548  double x, double y);
1549 
1565  GAIAGEO_DECLARE double gaiaMinDistance (double x0, double y0,
1566  int dims, double *coords, int vert);
1567 
1585  GAIAGEO_DECLARE int gaiaIntersect (double *x0, double *y0, double x1,
1586  double y1, double x2, double y2,
1587  double x3, double y3, double x4,
1588  double y4);
1589 
1600  GAIAGEO_DECLARE void gaiaShiftCoords (gaiaGeomCollPtr geom, double shift_x,
1601  double shift_y);
1602 
1614  GAIAGEO_DECLARE void gaiaShiftCoords3D (gaiaGeomCollPtr geom,
1615  double shift_x, double shift_y,
1616  double shift_z);
1617 
1631  GAIAGEO_DECLARE void gaiaShiftLongitude (gaiaGeomCollPtr geom);
1632 
1642  GAIAGEO_DECLARE void gaiaNormalizeLonLat (gaiaGeomCollPtr geom);
1643 
1644 
1654  GAIAGEO_DECLARE void gaiaScaleCoords (gaiaGeomCollPtr geom, double scale_x,
1655  double scale_y);
1656 
1665  GAIAGEO_DECLARE void gaiaRotateCoords (gaiaGeomCollPtr geom, double angle);
1666 
1678  GAIAGEO_DECLARE void gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axis,
1679  int y_axis);
1680 
1690  GAIAGEO_DECLARE void gaiaSwapCoords (gaiaGeomCollPtr geom);
1691 
1706  GAIAGEO_DECLARE int gaiaLinestringEquals (gaiaLinestringPtr line1,
1707  gaiaLinestringPtr line2);
1708 
1724  GAIAGEO_DECLARE int gaiaPolygonEquals (gaiaPolygonPtr polyg1,
1725  gaiaPolygonPtr polyg2);
1726 
1746  GAIAGEO_DECLARE int gaiaEllipseParams (const char *name, double *a,
1747  double *b, double *rf);
1748 
1767  GAIAGEO_DECLARE double gaiaGreatCircleDistance (double a, double b,
1768  double lat1, double lon1,
1769  double lat2, double lon2);
1770 
1790  GAIAGEO_DECLARE double gaiaGeodesicDistance (double a, double b, double rf,
1791  double lat1, double lon1,
1792  double lat2, double lon2);
1793 
1814  GAIAGEO_DECLARE double gaiaGreatCircleTotalLength (double a, double b,
1815  int dims, double *coords,
1816  int vert);
1817 
1839  GAIAGEO_DECLARE double gaiaGeodesicTotalLength (double a, double b,
1840  double rf, int dims,
1841  double *coords, int vert);
1842 
1857  GAIAGEO_DECLARE int gaiaConvertLength (double value, int unit_from,
1858  int unit_to, double *cvt);
1859 
1873  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeCircle (double center_x,
1874  double center_y,
1875  double radius, double step);
1876 
1888  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipse (double center_x,
1889  double center_y,
1890  double x_axis,
1891  double y_axis,
1892  double step);
1893 
1909  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeArc (double center_x,
1910  double center_y, double radius,
1911  double start, double stop,
1912  double step);
1913 
1927  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipticArc (double center_x,
1928  double center_y,
1929  double x_axis,
1930  double y_axis,
1931  double start,
1932  double stop,
1933  double step);
1934 
1952  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakePolygon (gaiaGeomCollPtr exterior,
1953  gaiaGeomCollPtr interiors);
1954 
1955 #ifdef __cplusplus
1956 }
1957 #endif
1958 
1959 #endif /* _GG_CORE_H */
GAIAGEO_DECLARE double gaiaMeasureLength(int dims, double *coords, int vert)
Measures the geometric length for a Linestring or Ring.
GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl(gaiaGeomCollPtr geom)
Checks for not-closed Rings in a Geometry object.
GAIAGEO_DECLARE void gaiaFreeGeomColl(gaiaGeomCollPtr geom)
Destroys a Geometry object.
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYM(int vert, int holes)
Allocates a 2D POLYGON [XYM].
GAIAGEO_DECLARE void gaiaCopyRingCoords(gaiaRingPtr dst, gaiaRingPtr src)
Copies coordinates between two RING objects.
GAIAGEO_DECLARE double gaiaGreatCircleTotalLength(double a, double b, int dims, double *coords, int vert)
Calculates the Great Circle Total Length for a Linestring / Ring.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZM(void)
Allocates a 3D Geometry [XYZM].
GAIAGEO_DECLARE int gaiaIsToxic_r(const void *p_cache, gaiaGeomCollPtr geom)
Checks for toxic Geometry object.
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZM(int vert)
Allocates a 3D RING [XYZM].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractLinestringsFromGeomColl(gaiaGeomCollPtr geom)
Extracts any Linestring from a Geometry object.
GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestringSpecial(gaiaLinestringPtr line, int mode)
Duplicates a Linestring object (special)
GAIAGEO_DECLARE int gaiaRingSetPoint(gaiaRingPtr rng, int v, double x, double y, double z, double m)
Sets coodinates for a Ring's Point.
GAIAGEO_DECLARE void gaiaFreePolygon(gaiaPolygonPtr polyg)
Destroys a POLYGON object.
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.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractPointsFromGeomColl(gaiaGeomCollPtr geom)
Extracts any Point from a Geometry object.
GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl_r(const void *p_data, gaiaGeomCollPtr geom)
Checks for not-closed Rings in a Geometry object.
GAIAGEO_DECLARE int gaiaIsNotClosedRing_r(const void *p_data, gaiaRingPtr ring)
Checks for not-closed Rings.
GAIAGEO_DECLARE double gaiaGeodesicDistance(double a, double b, double rf, double lat1, double lon1, double lat2, double lon2)
Calculates the Geodesic Distance between between two Points.
Container for OGC POINT Geometry.
Definition: gg_structs.h:68
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries_r(const void *p_cache, gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
Merges two Geometry objects into a single one.
Container for OGC POLYGON Geometry.
Definition: gg_structs.h:182
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolvePoints(gaiaGeomCollPtr geom)
Attempts to resolve a collection of Points from a Geometry object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollPoints(gaiaGeomCollPtr geom)
Duplicates a Geometry object [Points only].
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestring(int vert)
Allocates a 2D LINESTRING [XY].
GAIAGEO_DECLARE int gaiaIsNotClosedRing(gaiaRingPtr ring)
Checks for not-closed Rings.
GAIAGEO_DECLARE void gaiaFree(void *ptr)
Safely frees any dynamic memory block allocated by the library itself.
GAIAGEO_DECLARE void gaiaFreeRing(gaiaRingPtr ptr)
Destroys a RING object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZM(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 3D XYZM].
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZM(double x, double y, double z, double m)
Allocates a 3D POINT [XYZM].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeArc(double center_x, double center_y, double radius, double start, double stop, double step)
Creates a Circular Arc (Linestring) Geometry.
GAIAGEO_DECLARE int gaiaLineSetPoint(gaiaLinestringPtr ln, int v, double x, double y, double z, double m)
Sets coordinates for a Linestring's Point.
GAIAGEO_DECLARE int gaiaIsPointOnRingSurface(gaiaRingPtr ring, double pt_x, double pt_y)
Check if a Point lays on a Ring surface.
GAIAGEO_DECLARE int gaiaPolygonEquals(gaiaPolygonPtr polyg1, gaiaPolygonPtr polyg2)
Checks if two Polygons objects are equivalent.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakePolygon(gaiaGeomCollPtr exterior, gaiaGeomCollPtr interiors)
Creates a Polygon from closed Linestrings.
GAIAGEO_DECLARE void gaiaNormalizeLonLat(gaiaGeomCollPtr geom)
Shifts any coordinate to within the "normal range" of longitude and latitude values (-180...
GAIAGEO_DECLARE void gaiaAddPointToGeomColl(gaiaGeomCollPtr p, double x, double y)
Creates a new 2D Point [XY] object into a Geometry object.
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYM(int vert)
Allocates a 2D LINESTRING [XYM].
GAIAGEO_DECLARE gaiaRingPtr gaiaAddInteriorRing(gaiaPolygonPtr p, int pos, int vert)
Creates a new Interior Ring object into a Polygon object.
GAIAGEO_DECLARE int gaiaGeometryAliasType(gaiaGeomCollPtr geom)
Determines the corresponding Type for a Geometry object.
GAIAGEO_DECLARE gaiaPolygonPtr gaiaInsertPolygonInGeomColl(gaiaGeomCollPtr p, gaiaRingPtr ring)
Creates a new Polygon object into a Geometry object starting from an already existing Ring object...
GAIAGEO_DECLARE void gaiaCopyLinestringCoords(gaiaLinestringPtr dst, gaiaLinestringPtr src)
Copies coordinates between two LINESTRING objects.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYM(void)
Allocates a 2D Geometry [XYM].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeCircle(double center_x, double center_y, double radius, double step)
Creates a Circle (Linestring) Geometry.
GAIAGEO_DECLARE int gaiaIsToxic(gaiaGeomCollPtr geom)
Checks for toxic Geometry object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZ(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 3D XYZ].
Container for OGC RING Geometry.
Definition: gg_structs.h:148
GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZ(gaiaGeomCollPtr p, double x, double y, double z)
Creates a new 3D Point [XYZ] object into a Geometry object.
GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRingSpecial(gaiaRingPtr ring, int mode)
Duplicates a Ring object (special)
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.
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZM(int vert)
Allocates a 3D LINESTRING [XYZM].
GAIAGEO_DECLARE int gaiaDimension(gaiaGeomCollPtr geom)
Determines OGC dimensions for a Geometry object.
GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygonSpecial(gaiaPolygonPtr polyg, int mode)
Duplicates a Polygon object (special)
GAIAGEO_DECLARE int gaiaIsEmpty(gaiaGeomCollPtr geom)
Checks for empty Geometry object.
GAIAGEO_DECLARE void gaiaRingCentroid(gaiaRingPtr ring, double *rx, double *ry)
Determines the Centroid for a Ring object.
GAIAGEO_DECLARE void gaiaInsertLinestringInGeomColl(gaiaGeomCollPtr p, gaiaLinestringPtr line)
Inserts an already existing Linestring object into a Geometry object.
GAIAGEO_DECLARE int gaiaLinestringEquals(gaiaLinestringPtr line1, gaiaLinestringPtr line2)
Checks if two Linestring objects are equivalent.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollLinestrings(gaiaGeomCollPtr geom)
Duplicates a Geometry object [Linestrings only].
Container for OGC LINESTRING Geometry.
Definition: gg_structs.h:118
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLocateBetweenMeasures(gaiaGeomCollPtr geom, double m_start, double m_end)
Return a GeometryCollection containing elements matching the specified range of measures.
GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYM(gaiaGeomCollPtr p, double x, double y, double m)
Creates a new 2D Point [XYM] object into a Geometry object.
GAIAGEO_DECLARE void gaiaCopyLinestringCoordsReverse(gaiaLinestringPtr dst, gaiaLinestringPtr src)
Copies coordinates between two LINESTRING objects in reverse order.
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRing(int vert)
Allocates a 2D RING [XY].
GAIAGEO_DECLARE void gaiaCopyRingCoordsReverse(gaiaRingPtr dst, gaiaRingPtr src)
Copies coordinates between two RING objects in reverse order.
GAIAGEO_DECLARE void gaiaFreePoint(gaiaPointPtr ptr)
Destroys a POINT object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSanitize(gaiaGeomCollPtr org)
Attempts to sanitize a possibly malformed Geometry object.
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.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYM(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 2D XYM].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomColl(gaiaGeomCollPtr geom)
Duplicates a Geometry object.
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZ(int vert)
Allocates a 3D RING [XYZ].
GAIAGEO_DECLARE double gaiaMeasureArea(gaiaRingPtr ring)
Measures the geometric area for a Ring object.
GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRing(gaiaRingPtr ring)
Duplicates a Ring object.
GAIAGEO_DECLARE int gaiaConvertLength(double value, int unit_from, int unit_to, double *cvt)
Convert a Length from a Measure Unit to another.
GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestring(gaiaLinestringPtr line)
Duplicates a Linestring object.
GAIAGEO_DECLARE void gaiaAddRingToPolyg(gaiaPolygonPtr polyg, gaiaRingPtr ring)
Inserts an already existing Ring object into a Polygon object.
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYM(double x, double y, double m)
Allocates a 2D POINT [XYM].
GAIAGEO_DECLARE void gaiaInsertInteriorRing(gaiaPolygonPtr p, gaiaRingPtr ring)
Inserts an already existing Ring object into a Polygon object.
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPoint(double x, double y)
Allocates a 2D POINT [XY].
GAIAGEO_DECLARE int gaiaRingGetPoint(gaiaRingPtr rng, int v, double *x, double *y, double *z, double *m)
Gets coordinates from a Ring's Point.
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.
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZM(int vert, int holes)
Allocates a 3D POLYGON [XYZM].
GAIAGEO_DECLARE void gaiaShiftCoords(gaiaGeomCollPtr geom, double shift_x, double shift_y)
Shifts any coordinate within a Geometry object.
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZ(int vert, int holes)
Allocates a 3D POLYGON [XYZ].
GAIAGEO_DECLARE void gaiaShiftCoords3D(gaiaGeomCollPtr geom, double shift_x, double shift_y, double shift_z)
Shifts any coordinate within a 3D Geometry object.
GAIAGEO_DECLARE void gaiaReflectCoords(gaiaGeomCollPtr geom, int x_axis, int y_axis)
Reflects any coordinate within a Geometry object.
GAIAGEO_DECLARE int gaiaGeometryType(gaiaGeomCollPtr geom)
Determines the corresponding Type for a Geometry object.
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZ(double x, double y, double z)
Allocates a 3D POINT [XYZ].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLinearize(gaiaGeomCollPtr geom, int force_multi)
Attempts to resolve a (Multi)Linestring from a Geometry object.
GAIAGEO_DECLARE void gaiaSwapCoords(gaiaGeomCollPtr geom)
Swaps any coordinate within a Geometry object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomColl(void)
Allocates a 2D Geometry [XY].
GAIAGEO_DECLARE gaiaPolygonPtr gaiaCreatePolygon(gaiaRingPtr ring)
Allocates a POLYGON.
GAIAGEO_DECLARE void gaiaClockwise(gaiaRingPtr p)
Determines the direction for a Ring object.
GAIAGEO_DECLARE void gaiaShiftLongitude(gaiaGeomCollPtr geom)
Shifts negative longitudes.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZ(void)
Allocates a 3D Geometry [XYZ].
GAIAGEO_DECLARE void gaiaFreeLinestring(gaiaLinestringPtr ptr)
Destroys a LINESTRING object.
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAddLinestringToGeomColl(gaiaGeomCollPtr p, int vert)
Creates a new Linestring object into a Geometry object.
GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygon(gaiaPolygonPtr polyg)
Duplicates a Polygon object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollPolygons(gaiaGeomCollPtr geom)
Duplicates a Geometry object [Polygons only].
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZ(int vert)
Allocates a 3D LINESTRING [XYZ].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipse(double center_x, double center_y, double x_axis, double y_axis, double step)
Creates an Ellipse (Linestring) Geometry.
GAIAGEO_DECLARE int gaiaIsPointOnPolygonSurface(gaiaPolygonPtr polyg, double x, double y)
Checks if a Point lays on a Polygon surface.
Container for OGC GEOMETRYCOLLECTION Geometry.
Definition: gg_structs.h:216
GAIAGEO_DECLARE void gaiaRotateCoords(gaiaGeomCollPtr geom, double angle)
Rotates any coordinate within a Geometry object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries(gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2)
Merges two Geometry objects into a single one.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolveSegments(gaiaGeomCollPtr geom)
Attempts to resolve a collection of Segments from a Geometry object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXY(gaiaGeomCollPtr geom)
Duplicates a Geometry object [casting dimensions to 2D XY].
GAIAGEO_DECLARE int gaiaEllipseParams(const char *name, double *a, double *b, double *rf)
Retrieves Geodesic params for an Ellipsoid definition.
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.
GAIAGEO_DECLARE int gaiaLineGetPoint(gaiaLinestringPtr ln, int v, double *x, double *y, double *z, double *m)
Gets coodinates from a Linestring's Point.
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygon(int vert, int holes)
Allocates a 2D POLYGON [XY].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractPolygonsFromGeomColl(gaiaGeomCollPtr geom)
Extracts any Polygon from a Geometry object.
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.
GAIAGEO_DECLARE void gaiaScaleCoords(gaiaGeomCollPtr geom, double scale_x, double scale_y)
Scales any coordinate within a Geometry object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollSpecial(gaiaGeomCollPtr geom, int mode)
Duplicates a Geometry object (special)
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAddPolygonToGeomColl(gaiaGeomCollPtr p, int vert, int interiors)
Creates a new Polygon object into a Geometry object.
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYM(int vert)
Allocates 2D RING [XYM].