SpatiaLite
5.0.0
|
Geometry handling functions: core. More...
Go to the source code of this file.
Macros | |
#define | GAIA_GEODESIC_ARC_LENGTH_DEGREES 0 |
Arc Length measured in Degrees. | |
#define | GAIA_GEODESIC_ARC_LENGTH_METERS 1 |
Arc Length measured in Meters. | |
#define | GAIA_GEODESIC_CHORD_LENGTH_DEGREES 2 |
Chord Length measured in Degrees. | |
#define | GAIA_GEODESIC_CHORD_LENGTH_METERS 3 |
Chord Length measured in Meters. | |
#define | GAIA_GEODESIC_CENTRAL_ANGLE_RADIANS 4 |
Central Angle measured in Radians. | |
#define | GAIA_GEODESIC_CENTRAL_ANGLE_DEGREES 5 |
Central Angle measured in Degrees. | |
#define | GAIA_GEODESIC_ARC_AREA_METERS 6 |
Area of segment/arc measured in Square Meters. | |
#define | GAIA_GEODESIC_ARC_HEIGHT_METERS 7 |
Height of segment/arc in Meters. | |
Functions | |
GAIAGEO_DECLARE void | gaiaFree (void *ptr) |
Safely frees any dynamic memory block allocated by the library itself. More... | |
GAIAGEO_DECLARE gaiaPointPtr | gaiaAllocPoint (double x, double y) |
Allocates a 2D POINT [XY]. More... | |
GAIAGEO_DECLARE gaiaPointPtr | gaiaAllocPointXYZ (double x, double y, double z) |
Allocates a 3D POINT [XYZ]. More... | |
GAIAGEO_DECLARE gaiaPointPtr | gaiaAllocPointXYM (double x, double y, double m) |
Allocates a 2D POINT [XYM]. More... | |
GAIAGEO_DECLARE gaiaPointPtr | gaiaAllocPointXYZM (double x, double y, double z, double m) |
Allocates a 3D POINT [XYZM]. More... | |
GAIAGEO_DECLARE void | gaiaFreePoint (gaiaPointPtr ptr) |
Destroys a POINT object. More... | |
GAIAGEO_DECLARE gaiaLinestringPtr | gaiaAllocLinestring (int vert) |
Allocates a 2D LINESTRING [XY]. More... | |
GAIAGEO_DECLARE gaiaLinestringPtr | gaiaAllocLinestringXYZ (int vert) |
Allocates a 3D LINESTRING [XYZ]. More... | |
GAIAGEO_DECLARE gaiaLinestringPtr | gaiaAllocLinestringXYM (int vert) |
Allocates a 2D LINESTRING [XYM]. More... | |
GAIAGEO_DECLARE gaiaLinestringPtr | gaiaAllocLinestringXYZM (int vert) |
Allocates a 3D LINESTRING [XYZM]. More... | |
GAIAGEO_DECLARE void | gaiaFreeLinestring (gaiaLinestringPtr ptr) |
Destroys a LINESTRING object. More... | |
GAIAGEO_DECLARE void | gaiaCopyLinestringCoords (gaiaLinestringPtr dst, gaiaLinestringPtr src) |
Copies coordinates between two LINESTRING objects. More... | |
GAIAGEO_DECLARE void | gaiaCopyLinestringCoordsEx (gaiaLinestringPtr dst, gaiaLinestringPtr src, double z_no_data, double m_no_data) |
Copies coordinates between two LINESTRING objects. More... | |
GAIAGEO_DECLARE void | gaiaCopyLinestringCoordsReverse (gaiaLinestringPtr dst, gaiaLinestringPtr src) |
Copies coordinates between two LINESTRING objects in reverse order. More... | |
GAIAGEO_DECLARE gaiaRingPtr | gaiaAllocRing (int vert) |
Allocates a 2D RING [XY]. More... | |
GAIAGEO_DECLARE gaiaRingPtr | gaiaAllocRingXYZ (int vert) |
Allocates a 3D RING [XYZ]. More... | |
GAIAGEO_DECLARE gaiaRingPtr | gaiaAllocRingXYM (int vert) |
Allocates 2D RING [XYM]. More... | |
GAIAGEO_DECLARE gaiaRingPtr | gaiaAllocRingXYZM (int vert) |
Allocates a 3D RING [XYZM]. More... | |
GAIAGEO_DECLARE void | gaiaFreeRing (gaiaRingPtr ptr) |
Destroys a RING object. More... | |
GAIAGEO_DECLARE void | gaiaCopyRingCoords (gaiaRingPtr dst, gaiaRingPtr src) |
Copies coordinates between two RING objects. More... | |
GAIAGEO_DECLARE void | gaiaCopyRingCoordsEx (gaiaRingPtr dst, gaiaRingPtr src, double z_no_data, double m_no_data) |
Copies coordinates between two RING objects. More... | |
GAIAGEO_DECLARE void | gaiaCopyRingCoordsReverse (gaiaRingPtr dst, gaiaRingPtr src) |
Copies coordinates between two RING objects in reverse order. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaAllocPolygon (int vert, int holes) |
Allocates a 2D POLYGON [XY]. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaAllocPolygonXYZ (int vert, int holes) |
Allocates a 3D POLYGON [XYZ]. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaAllocPolygonXYM (int vert, int holes) |
Allocates a 2D POLYGON [XYM]. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaAllocPolygonXYZM (int vert, int holes) |
Allocates a 3D POLYGON [XYZM]. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaCreatePolygon (gaiaRingPtr ring) |
Allocates a POLYGON. More... | |
GAIAGEO_DECLARE void | gaiaFreePolygon (gaiaPolygonPtr polyg) |
Destroys a POLYGON object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaAllocGeomColl (void) |
Allocates a 2D Geometry [XY]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaAllocGeomCollXYZ (void) |
Allocates a 3D Geometry [XYZ]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaAllocGeomCollXYM (void) |
Allocates a 2D Geometry [XYM]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaAllocGeomCollXYZM (void) |
Allocates a 3D Geometry [XYZM]. More... | |
GAIAGEO_DECLARE void | gaiaFreeGeomColl (gaiaGeomCollPtr geom) |
Destroys a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaAddPointToGeomColl (gaiaGeomCollPtr p, double x, double y) |
Creates a new 2D Point [XY] object into a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaAddPointToGeomCollXYZ (gaiaGeomCollPtr p, double x, double y, double z) |
Creates a new 3D Point [XYZ] object into a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaAddPointToGeomCollXYM (gaiaGeomCollPtr p, double x, double y, double m) |
Creates a new 2D Point [XYM] object into a Geometry object. More... | |
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. More... | |
GAIAGEO_DECLARE gaiaLinestringPtr | gaiaAddLinestringToGeomColl (gaiaGeomCollPtr p, int vert) |
Creates a new Linestring object into a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaInsertLinestringInGeomColl (gaiaGeomCollPtr p, gaiaLinestringPtr line) |
Inserts an already existing Linestring object into a Geometry object. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaAddPolygonToGeomColl (gaiaGeomCollPtr p, int vert, int interiors) |
Creates a new Polygon object into a Geometry object. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaInsertPolygonInGeomColl (gaiaGeomCollPtr p, gaiaRingPtr ring) |
Creates a new Polygon object into a Geometry object starting from an already existing Ring object. More... | |
GAIAGEO_DECLARE gaiaRingPtr | gaiaAddInteriorRing (gaiaPolygonPtr p, int pos, int vert) |
Creates a new Interior Ring object into a Polygon object. More... | |
GAIAGEO_DECLARE void | gaiaInsertInteriorRing (gaiaPolygonPtr p, gaiaRingPtr ring) |
Inserts an already existing Ring object into a Polygon object. More... | |
GAIAGEO_DECLARE void | gaiaAddRingToPolyg (gaiaPolygonPtr polyg, gaiaRingPtr ring) |
Inserts an already existing Ring object into a Polygon object. More... | |
GAIAGEO_DECLARE gaiaLinestringPtr | gaiaCloneLinestring (gaiaLinestringPtr line) |
Duplicates a Linestring object. More... | |
GAIAGEO_DECLARE gaiaLinestringPtr | gaiaCloneLinestringSpecial (gaiaLinestringPtr line, int mode) |
Duplicates a Linestring object (special) More... | |
GAIAGEO_DECLARE gaiaRingPtr | gaiaCloneRing (gaiaRingPtr ring) |
Duplicates a Ring object. More... | |
GAIAGEO_DECLARE gaiaRingPtr | gaiaCloneRingSpecial (gaiaRingPtr ring, int mode) |
Duplicates a Ring object (special) More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaClonePolygon (gaiaPolygonPtr polyg) |
Duplicates a Polygon object. More... | |
GAIAGEO_DECLARE gaiaPolygonPtr | gaiaClonePolygonSpecial (gaiaPolygonPtr polyg, int mode) |
Duplicates a Polygon object (special) More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCloneGeomColl (gaiaGeomCollPtr geom) |
Duplicates a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCloneGeomCollSpecial (gaiaGeomCollPtr geom, int mode) |
Duplicates a Geometry object (special) More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCloneGeomCollPoints (gaiaGeomCollPtr geom) |
Duplicates a Geometry object [Points only]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCloneGeomCollLinestrings (gaiaGeomCollPtr geom) |
Duplicates a Geometry object [Linestrings only]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCloneGeomCollPolygons (gaiaGeomCollPtr geom) |
Duplicates a Geometry object [Polygons only]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCastGeomCollToXY (gaiaGeomCollPtr geom) |
Duplicates a Geometry object [casting dimensions to 2D XY]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCastGeomCollToXYZ (gaiaGeomCollPtr geom) |
Duplicates a Geometry object [casting dimensions to 3D XYZ]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCastGeomCollToXYM (gaiaGeomCollPtr geom) |
Duplicates a Geometry object [casting dimensions to 2D XYM]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCastGeomCollToXYZM (gaiaGeomCollPtr geom) |
Duplicates a Geometry object [casting dimensions to 3D XYZM]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCastGeomCollToXYZnoData (gaiaGeomCollPtr geom, double no_data) |
Duplicates a Geometry object [casting dimensions to 3D XYZ - noData]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCastGeomCollToXYMnoData (gaiaGeomCollPtr geom, double no_data) |
Duplicates a Geometry object [casting dimensions to 2D XYM - noData]. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaCastGeomCollToXYZMnoData (gaiaGeomCollPtr geom, double z_no_data, double m_no_data) |
Duplicates a Geometry object [casting dimensions to 3D XYZM - noData]. More... | |
GAIAGEO_DECLARE int | gaiaLineGetPoint (gaiaLinestringPtr ln, int v, double *x, double *y, double *z, double *m) |
Gets coodinates from a Linestring's Point. More... | |
GAIAGEO_DECLARE int | gaiaLineSetPoint (gaiaLinestringPtr ln, int v, double x, double y, double z, double m) |
Sets coordinates for a Linestring's Point. More... | |
GAIAGEO_DECLARE int | gaiaRingGetPoint (gaiaRingPtr rng, int v, double *x, double *y, double *z, double *m) |
Gets coordinates from a Ring's Point. More... | |
GAIAGEO_DECLARE int | gaiaRingSetPoint (gaiaRingPtr rng, int v, double x, double y, double z, double m) |
Sets coodinates for a Ring's Point. More... | |
GAIAGEO_DECLARE int | gaiaDimension (gaiaGeomCollPtr geom) |
Determines OGC dimensions for a Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaGeometryType (gaiaGeomCollPtr geom) |
Determines the corresponding Type for a Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaGeometryAliasType (gaiaGeomCollPtr geom) |
Determines the corresponding Type for a Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaIsEmpty (gaiaGeomCollPtr geom) |
Checks for empty Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaCheckClockwise (gaiaGeomCollPtr geom) |
Checks for Clockwise Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaCheckCounterClockwise (gaiaGeomCollPtr geom) |
Checks for CounterClockwise Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaIsToxic (gaiaGeomCollPtr geom) |
Checks for toxic Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaIsToxic_r (const void *p_cache, gaiaGeomCollPtr geom) |
Checks for toxic Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaIsNotClosedRing (gaiaRingPtr ring) |
Checks for not-closed Rings. More... | |
GAIAGEO_DECLARE int | gaiaIsNotClosedRing_r (const void *p_data, gaiaRingPtr ring) |
Checks for not-closed Rings. More... | |
GAIAGEO_DECLARE int | gaiaIsNotClosedGeomColl (gaiaGeomCollPtr geom) |
Checks for not-closed Rings in a Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaIsNotClosedGeomColl_r (const void *p_data, gaiaGeomCollPtr geom) |
Checks for not-closed Rings in a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaSanitize (gaiaGeomCollPtr org) |
Attempts to sanitize a possibly malformed Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaEnsureClosedRings (gaiaGeomCollPtr org) |
Attempts to sanitize a possibly malformed Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaRemoveRepeatedPoints (gaiaGeomCollPtr org, double tolerance) |
Attempts to sanitize a possibly malformed Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaLinearize (gaiaGeomCollPtr geom, int force_multi) |
Attempts to resolve a (Multi)Linestring from a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaDissolveSegments (gaiaGeomCollPtr geom) |
Attempts to resolve a collection of Segments from a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaDissolvePoints (gaiaGeomCollPtr geom) |
Attempts to resolve a collection of Points from a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaExtractPointsFromGeomColl (gaiaGeomCollPtr geom) |
Extracts any Point from a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaExtractLinestringsFromGeomColl (gaiaGeomCollPtr geom) |
Extracts any Linestring from a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaExtractPolygonsFromGeomColl (gaiaGeomCollPtr geom) |
Extracts any Polygon from a Geometry object. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaMergeGeometries (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2) |
Merges two Geometry objects into a single one. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaMergeGeometries_r (const void *p_cache, gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2) |
Merges two Geometry objects into a single one. More... | |
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 end points. More... | |
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. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaLocateBetweenMeasures (gaiaGeomCollPtr geom, double m_start, double m_end) |
Return a GeometryCollection containing elements matching the specified range of measures. More... | |
GAIAGEO_DECLARE int | gaiaIsValidTrajectory (gaiaGeomCollPtr geom) |
Checks if a Geometry object is valid Trajectory. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaTrajectoryInterpolatePoint (gaiaGeomCollPtr geom, double m) |
Attempts to interpolate a Point along a Trajectory accordingly to given M-Value. More... | |
GAIAGEO_DECLARE double | gaiaMeasureLength (int dims, double *coords, int vert) |
Measures the geometric length for a Linestring or Ring. More... | |
GAIAGEO_DECLARE double | gaiaMeasureArea (gaiaRingPtr ring) |
Measures the geometric area for a Ring object. More... | |
GAIAGEO_DECLARE void | gaiaRingCentroid (gaiaRingPtr ring, double *rx, double *ry) |
Determines the Centroid for a Ring object. More... | |
GAIAGEO_DECLARE void | gaiaClockwise (gaiaRingPtr p) |
Determines the direction for a Ring object. More... | |
GAIAGEO_DECLARE int | gaiaIsPointOnRingSurface (gaiaRingPtr ring, double pt_x, double pt_y) |
Check if a Point lays on a Ring surface. More... | |
GAIAGEO_DECLARE int | gaiaIsPointOnPolygonSurface (gaiaPolygonPtr polyg, double x, double y) |
Checks if a Point lays on a Polygon surface. More... | |
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. More... | |
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. More... | |
GAIAGEO_DECLARE void | gaiaShiftCoords (gaiaGeomCollPtr geom, double shift_x, double shift_y) |
Shifts any coordinate within a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaShiftCoords3D (gaiaGeomCollPtr geom, double shift_x, double shift_y, double shift_z) |
Shifts any coordinate within a 3D Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaShiftLongitude (gaiaGeomCollPtr geom) |
Shifts negative longitudes. More... | |
GAIAGEO_DECLARE void | gaiaNormalizeLonLat (gaiaGeomCollPtr geom) |
Shifts any coordinate to within the "normal range" of longitude and latitude values (-180.0 to 180.0 longitude and -90.0 to 90.0 latitude). More... | |
GAIAGEO_DECLARE void | gaiaScaleCoords (gaiaGeomCollPtr geom, double scale_x, double scale_y) |
Scales any coordinate within a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaRotateCoords (gaiaGeomCollPtr geom, double angle) |
Rotates any coordinate within a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axis, int y_axis) |
Reflects any coordinate within a Geometry object. More... | |
GAIAGEO_DECLARE void | gaiaSwapCoords (gaiaGeomCollPtr geom) |
Swaps any coordinate within a Geometry object. More... | |
GAIAGEO_DECLARE int | gaiaLinestringEquals (gaiaLinestringPtr line1, gaiaLinestringPtr line2) |
Checks if two Linestring objects are equivalent. More... | |
GAIAGEO_DECLARE int | gaiaPolygonEquals (gaiaPolygonPtr polyg1, gaiaPolygonPtr polyg2) |
Checks if two Polygons objects are equivalent. More... | |
GAIAGEO_DECLARE int | gaiaEllipseParams (const char *name, double *a, double *b, double *rf) |
Retrieves Geodesic params for an Ellipsoid definition. More... | |
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. More... | |
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. More... | |
GAIAGEO_DECLARE double | gaiaGreatCircleTotalLength (double a, double b, int dims, double *coords, int vert) |
Calculates the Great Circle Total Length for a Linestring / Ring. More... | |
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. More... | |
GAIAGEO_DECLARE int | gaiaConvertLength (double value, int unit_from, int unit_to, double *cvt) |
Convert a Length from a Measure Unit to another. More... | |
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. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaMakeCircle (double center_x, double center_y, double radius, double step) |
Creates a Circle (Linestring) Geometry. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaMakeEllipse (double center_x, double center_y, double x_axis, double y_axis, double step) |
Creates an Ellipse (Linestring) Geometry. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaMakeArc (double center_x, double center_y, double radius, double start, double stop, double step) |
Creates a Circular Arc (Linestring) Geometry. More... | |
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. More... | |
GAIAGEO_DECLARE gaiaGeomCollPtr | gaiaMakePolygon (gaiaGeomCollPtr exterior, gaiaGeomCollPtr interiors) |
Creates a Polygon from closed Linestrings. More... | |
GAIAGEO_DECLARE double | gaiaCurvosityIndex (const void *p_cache, gaiaLinestringPtr line, int extra_points) |
Computes the Curvosity Index for some Linestrings. More... | |
GAIAGEO_DECLARE void | gaiaUpDownHeight (gaiaLinestringPtr line, double *up, double *down) |
Computes the Uphill and Downhill total Height for some 3D Linestrings. More... | |
Geometry handling functions: core.
GAIAGEO_DECLARE gaiaRingPtr gaiaAddInteriorRing | ( | gaiaPolygonPtr | p, |
int | pos, | ||
int | vert | ||
) |
Creates a new Interior Ring object into a Polygon object.
p | pointer to the Polygon object. |
pos | relative position index [first Interior Ring has index 0]. |
vert | number of points (aka vertices) into the Ring. |
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAddLinestringToGeomColl | ( | gaiaGeomCollPtr | p, |
int | vert | ||
) |
Creates a new Linestring object into a Geometry object.
p | pointer to the Geometry object. |
vert | number of points [aka vertices] into the Linestring. |
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 end points.
geom | pointer to Geometry object of the Linestring or MultiLinestring type. |
m_start | M start value |
m_end | M end value |
GAIAGEO_DECLARE void gaiaAddPointToGeomColl | ( | gaiaGeomCollPtr | p, |
double | x, | ||
double | y | ||
) |
Creates a new 2D Point [XY] object into a Geometry object.
p | pointer to the Geometry object |
x | X coordinate of the Point to be created |
y | X coordinate of the Point to be created |
GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYM | ( | gaiaGeomCollPtr | p, |
double | x, | ||
double | y, | ||
double | m | ||
) |
Creates a new 2D Point [XYM] object into a Geometry object.
p | pointer to the Geometry object |
x | X coordinate of the Point to be created |
y | X coordinate of the Point to be created |
m | M measure of the Point to be created |
GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZ | ( | gaiaGeomCollPtr | p, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Creates a new 3D Point [XYZ] object into a Geometry object.
p | pointer to the Geometry object |
x | X coordinate of the Point to be created |
y | X coordinate of the Point to be created |
z | Z coordinate of the Point to be created |
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.
p | pointer to the Geometry object |
x | X coordinate of the Point to be created |
y | X coordinate of the Point to be created |
z | Z coordinate of the Point to be created |
m | M measure of the Point to be created |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAddPolygonToGeomColl | ( | gaiaGeomCollPtr | p, |
int | vert, | ||
int | interiors | ||
) |
Creates a new Polygon object into a Geometry object.
p | pointer to the Geometry object. |
vert | number of points [aka vertices] into the Polygon's Exterior Ring. |
interiors | number of Interiors Rings [0, if no Interior Ring is required] |
GAIAGEO_DECLARE void gaiaAddRingToPolyg | ( | gaiaPolygonPtr | polyg, |
gaiaRingPtr | ring | ||
) |
Inserts an already existing Ring object into a Polygon object.
polyg | pointer to the Polygon object |
ring | pointer to the Ring object |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomColl | ( | void | ) |
Allocates a 2D Geometry [XY].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYM | ( | void | ) |
Allocates a 2D Geometry [XYM].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZ | ( | void | ) |
Allocates a 3D Geometry [XYZ].
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZM | ( | void | ) |
Allocates a 3D Geometry [XYZM].
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestring | ( | int | vert | ) |
Allocates a 2D LINESTRING [XY].
vert | number of points [aka vertices] into the Linestring |
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYM | ( | int | vert | ) |
Allocates a 2D LINESTRING [XYM].
vert | number of points [aka vertices] into the Linestring |
object: in this case destroying the higher order object will implicitly destroy any contained child object.
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZ | ( | int | vert | ) |
Allocates a 3D LINESTRING [XYZ].
vert | number of points [aka vertices] into the Linestring |
object: in this case destroying the higher order object will implicitly destroy any contained child object.
GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZM | ( | int | vert | ) |
Allocates a 3D LINESTRING [XYZM].
vert | number of points [aka vertices] into the Linestring |
object: in this case destroying the higher order object will implicitly destroy any contained child object.
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPoint | ( | double | x, |
double | y | ||
) |
Allocates a 2D POINT [XY].
x | the X coordinate. |
y | the Y coordinate. |
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYM | ( | double | x, |
double | y, | ||
double | m | ||
) |
Allocates a 2D POINT [XYM].
x | the X coordinate. |
y | the Y coordinate. |
m | the M measure. |
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZ | ( | double | x, |
double | y, | ||
double | z | ||
) |
Allocates a 3D POINT [XYZ].
x | the X coordinate. |
y | the Y coordinate. |
z | the Z coordinate. |
GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZM | ( | double | x, |
double | y, | ||
double | z, | ||
double | m | ||
) |
Allocates a 3D POINT [XYZM].
x | the X coordinate. |
y | the Y coordinate. |
z | the Z coordinate. |
m | the M measure. |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygon | ( | int | vert, |
int | holes | ||
) |
Allocates a 2D POLYGON [XY].
vert | number of points [aka vertices] into the Exterior Ring. |
holes | number of Interior Rings [0, if no Interior Ring is required]. |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYM | ( | int | vert, |
int | holes | ||
) |
Allocates a 2D POLYGON [XYM].
vert | number of points [aka vertices] into the Exterior Ring. |
holes | number of Interior Rings [0, if no Interior Ring is required]. |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZ | ( | int | vert, |
int | holes | ||
) |
Allocates a 3D POLYGON [XYZ].
vert | number of points [aka vertices] into the Exterior Ring. |
holes | number of Interior Rings [0, if no Interior Ring is required]. |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZM | ( | int | vert, |
int | holes | ||
) |
Allocates a 3D POLYGON [XYZM].
vert | number of points [aka vertices] into the Exterior Ring. |
holes | number of Interior Rings [may by 0, if no Interior Ring is required]. |
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRing | ( | int | vert | ) |
Allocates a 2D RING [XY].
vert | number of points [aka vertices] into the Ring |
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYM | ( | int | vert | ) |
Allocates 2D RING [XYM].
vert | number of points [aka vertices] into the Ring |
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZ | ( | int | vert | ) |
Allocates a 3D RING [XYZ].
vert | number of points [aka vertices] into the Ring |
GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZM | ( | int | vert | ) |
Allocates a 3D RING [XYZM].
vert | number of points [aka vertices] into the Ring |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXY | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object [casting dimensions to 2D XY].
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYM | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object [casting dimensions to 2D XYM].
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYMnoData | ( | gaiaGeomCollPtr | geom, |
double | no_data | ||
) |
Duplicates a Geometry object [casting dimensions to 2D XYM - noData].
geom | pointer to Geometry object [origin]. |
no_data | the default M value |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZ | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object [casting dimensions to 3D XYZ].
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZM | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object [casting dimensions to 3D XYZM].
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZMnoData | ( | gaiaGeomCollPtr | geom, |
double | z_no_data, | ||
double | m_no_data | ||
) |
Duplicates a Geometry object [casting dimensions to 3D XYZM - noData].
geom | pointer to Geometry object [origin]. |
z_no_data | the default Z value |
m_no_data | the default M value |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZnoData | ( | gaiaGeomCollPtr | geom, |
double | no_data | ||
) |
Duplicates a Geometry object [casting dimensions to 3D XYZ - noData].
geom | pointer to Geometry object [origin]. |
no_data | the default Z value |
GAIAGEO_DECLARE int gaiaCheckClockwise | ( | gaiaGeomCollPtr | geom | ) |
Checks for Clockwise Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE int gaiaCheckCounterClockwise | ( | gaiaGeomCollPtr | geom | ) |
Checks for CounterClockwise Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE void gaiaClockwise | ( | gaiaRingPtr | p | ) |
Determines the direction for a Ring object.
p | pointer to Ring object |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomColl | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object.
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollLinestrings | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object [Linestrings only].
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollPoints | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object [Points only].
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollPolygons | ( | gaiaGeomCollPtr | geom | ) |
Duplicates a Geometry object [Polygons only].
geom | pointer to Geometry object [origin]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomCollSpecial | ( | gaiaGeomCollPtr | geom, |
int | mode | ||
) |
Duplicates a Geometry object (special)
geom | pointer to Geometry object [origin]. |
mode | one of GAIA_SAME_ORDER, GAIA_REVERSE_ORDER or GAIA_LHR_ORDER. |
GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestring | ( | gaiaLinestringPtr | line | ) |
Duplicates a Linestring object.
line | pointer to Linestring object [origin]. |
GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestringSpecial | ( | gaiaLinestringPtr | line, |
int | mode | ||
) |
Duplicates a Linestring object (special)
line | pointer to Linestring object [origin]. |
mode | one of GAIA_SAME_ORDER or GAIA_REVERSE_ORDER. |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygon | ( | gaiaPolygonPtr | polyg | ) |
Duplicates a Polygon object.
polyg | pointer to Polygon object [origin]. |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygonSpecial | ( | gaiaPolygonPtr | polyg, |
int | mode | ||
) |
Duplicates a Polygon object (special)
polyg | pointer to Polygon object [origin]. |
mode | one of GAIA_SAME_ORDER, GAIA_REVERSE_ORDER, or GAIA_LHR_ORDER. |
GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRing | ( | gaiaRingPtr | ring | ) |
Duplicates a Ring object.
ring | pointer to Ring object [origin]. |
GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRingSpecial | ( | gaiaRingPtr | ring, |
int | mode | ||
) |
Duplicates a Ring object (special)
ring | pointer to Ring object [origin]. |
mode | one of GAIA_SAME_ORDER or GAIA_REVERSE_ORDER. |
GAIAGEO_DECLARE int gaiaConvertLength | ( | double | value, |
int | unit_from, | ||
int | unit_to, | ||
double * | cvt | ||
) |
Convert a Length from a Measure Unit to another.
value | the length measure to be converted. |
unit_from | original Measure Unit. |
unit_to | converted Measure Unit. |
cvt | on completion this variable will contain the converted length measure. |
GAIAGEO_DECLARE void gaiaCopyLinestringCoords | ( | gaiaLinestringPtr | dst, |
gaiaLinestringPtr | src | ||
) |
Copies coordinates between two LINESTRING objects.
dst | destination LINESTRING [output] |
src | origin LINESTRING [input] |
GAIAGEO_DECLARE void gaiaCopyLinestringCoordsEx | ( | gaiaLinestringPtr | dst, |
gaiaLinestringPtr | src, | ||
double | z_no_data, | ||
double | m_no_data | ||
) |
Copies coordinates between two LINESTRING objects.
dst | destination LINESTRING [output] |
src | origin LINESTRING [input] |
z_no_data | the default Z value \parma m_no_data the default M value |
GAIAGEO_DECLARE void gaiaCopyLinestringCoordsReverse | ( | gaiaLinestringPtr | dst, |
gaiaLinestringPtr | src | ||
) |
Copies coordinates between two LINESTRING objects in reverse order.
dst | destination LINESTRING [output] |
src | origin LINESTRING [input] |
GAIAGEO_DECLARE void gaiaCopyRingCoords | ( | gaiaRingPtr | dst, |
gaiaRingPtr | src | ||
) |
Copies coordinates between two RING objects.
dst | destination RING [output] |
src | origin RING [input] |
GAIAGEO_DECLARE void gaiaCopyRingCoordsEx | ( | gaiaRingPtr | dst, |
gaiaRingPtr | src, | ||
double | z_no_data, | ||
double | m_no_data | ||
) |
Copies coordinates between two RING objects.
dst | destination RING [output] |
src | origin RING [input] |
z_no_data | the default Z value |
m_no_data | the default M value |
GAIAGEO_DECLARE void gaiaCopyRingCoordsReverse | ( | gaiaRingPtr | dst, |
gaiaRingPtr | src | ||
) |
Copies coordinates between two RING objects in reverse order.
dst | destination RING [output] |
src | origin RING [input] |
GAIAGEO_DECLARE gaiaPolygonPtr gaiaCreatePolygon | ( | gaiaRingPtr | ring | ) |
Allocates a POLYGON.
ring | pointer to a valid RING object: assumed to be the Polygon's Exterior Ring. |
GAIAGEO_DECLARE double gaiaCurvosityIndex | ( | const void * | p_cache, |
gaiaLinestringPtr | line, | ||
int | extra_points | ||
) |
Computes the Curvosity Index for some Linestrings.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
line | a generic Linestring. |
extra_points | number of points to be interpolated at regular distance into the reference line. |
GAIAGEO_DECLARE int gaiaDimension | ( | gaiaGeomCollPtr | geom | ) |
Determines OGC dimensions for a Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolvePoints | ( | gaiaGeomCollPtr | geom | ) |
Attempts to resolve a collection of Points from a Geometry object.
geom | pointer to Geometry object. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaDissolveSegments | ( | gaiaGeomCollPtr | geom | ) |
Attempts to resolve a collection of Segments from a Geometry object.
geom | pointer to Geometry object. |
GAIAGEO_DECLARE int gaiaEllipseParams | ( | const char * | name, |
double * | a, | ||
double * | b, | ||
double * | rf | ||
) |
Retrieves Geodesic params for an Ellipsoid definition.
name | text string identifying an Ellipsoid definition. |
a | on completion this variable will contain the first geodesic param. |
b | on completion this variable will contain the second geodesic param. |
rf | on completion this variable will contain the third geodesic param. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaEnsureClosedRings | ( | gaiaGeomCollPtr | org | ) |
Attempts to sanitize a possibly malformed Geometry object.
org | pointer to Geometry object. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractLinestringsFromGeomColl | ( | gaiaGeomCollPtr | geom | ) |
Extracts any Linestring from a Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractPointsFromGeomColl | ( | gaiaGeomCollPtr | geom | ) |
Extracts any Point from a Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaExtractPolygonsFromGeomColl | ( | gaiaGeomCollPtr | geom | ) |
Extracts any Polygon from a Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE void gaiaFree | ( | void * | ptr | ) |
Safely frees any dynamic memory block allocated by the library itself.
ptr | pointer to dynamically allocated memory |
GAIAGEO_DECLARE void gaiaFreeGeomColl | ( | gaiaGeomCollPtr | geom | ) |
Destroys a Geometry object.
geom | pointer to the Geometry object to be destroyed |
GAIAGEO_DECLARE void gaiaFreeLinestring | ( | gaiaLinestringPtr | ptr | ) |
Destroys a LINESTRING object.
ptr | pointer to the LINESTRING object to be destroyed |
GAIAGEO_DECLARE void gaiaFreePoint | ( | gaiaPointPtr | ptr | ) |
Destroys a POINT object.
ptr | pointer to the POINT object to be destroyed |
GAIAGEO_DECLARE void gaiaFreePolygon | ( | gaiaPolygonPtr | polyg | ) |
Destroys a POLYGON object.
polyg | pointer to the POLYGON object to be destroyed |
GAIAGEO_DECLARE void gaiaFreeRing | ( | gaiaRingPtr | ptr | ) |
Destroys a RING object.
ptr | pointer to the RING object to be destroyed |
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.
db_handle | handle to the current DB connection. |
cache | the same memory pointer passed to the corresponding call to spatialite_init_ex() and returned by spatialite_alloc_connection() |
geom1 | the first Geometry. |
geom2 | the second Geometry. |
return_type | selects wich value has be computed. Must be one between: GAIA_GEODESIC_ARC_LENGTH_METERS, GAIA_GEODESIC_ARC_LENGTH_DEGREES, GAIA_GEODESIC_CHORD_LENGTH_METERS, GAIA_GEODESIC_CHORD_LENGTH_DEGREES, GAIA_GEODESIC_CENTRAL_ANGLE_DEGREES, GAIA_GEODESIC_CENTRAL_ANGLE_RADIANS, GAIA_GEODESIC_ARC_AREA_METERS or GAIA_GEODESIC_ARC_HEIGHT_METERS. |
retval | on completion this variable will contain the computed value. |
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.
a | first geodesic parameter. |
b | second geodesic parameter. |
rf | third geodesic parameter. |
lat1 | Latitude of first Point. |
lon1 | Longitude of first Point. |
lat2 | Latitude of second Point. |
lon2 | Longitude of second Point. |
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.
a | first geodesic parameter. |
b | second geodesic parameter. |
rf | third geodesic parameter. |
dims | dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_ZM |
coords | pointed to COORD mem-array |
vert | number of Points (aka Vertices) within the COORD mem-array |
GAIAGEO_DECLARE int gaiaGeometryAliasType | ( | gaiaGeomCollPtr | geom | ) |
Determines the corresponding Type for a Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE int gaiaGeometryType | ( | gaiaGeomCollPtr | geom | ) |
Determines the corresponding Type for a Geometry object.
geom | pointer to Geometry object |
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.
a | first geodesic parameter. |
b | second geodesic parameter. |
lat1 | Latitude of first Point. |
lon1 | Longitude of first Point. |
lat2 | Latitude of second Point. |
lon2 | Longitude of second Point. |
GAIAGEO_DECLARE double gaiaGreatCircleTotalLength | ( | double | a, |
double | b, | ||
int | dims, | ||
double * | coords, | ||
int | vert | ||
) |
Calculates the Great Circle Total Length for a Linestring / Ring.
a | first geodesic parameter. |
b | second geodesic parameter. |
dims | dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_ZM |
coords | pointed to COORD mem-array |
vert | number of Points (aka Vertices) within the COORD mem-array |
GAIAGEO_DECLARE void gaiaInsertInteriorRing | ( | gaiaPolygonPtr | p, |
gaiaRingPtr | ring | ||
) |
Inserts an already existing Ring object into a Polygon object.
p | pointer to the Polygon object |
ring | pointer to the Ring object |
GAIAGEO_DECLARE void gaiaInsertLinestringInGeomColl | ( | gaiaGeomCollPtr | p, |
gaiaLinestringPtr | line | ||
) |
Inserts an already existing Linestring object into a Geometry object.
p | pointer to the Geometry object. |
line | pointer to the Linestring 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.
p | pointer to the Geometry object. |
ring | pointer to the Ring object [assumed to represent to Polygon's Exterior Ring]. |
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.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
line | pointer to Geometry object of the Linestring type and supporting the M dimension. |
point | pointer to Geometry object of the Point type. |
m_value | on succesfull completion this variable will contain the interpolated M value |
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.
x0 | on completion this variable will contain the Intersection X coord |
y0 | on completion this variable will contain the Intersection Y coord |
x1 | start Point X of first Segment |
y1 | start Point Y of first Segment |
x2 | end Point X of first Segment |
y2 | end Point Y of first Segment |
x3 | start Point X of second Segment |
y3 | start Point Y of second Segment |
x4 | end Point X of second Segment |
y4 | end Point Y of second Segment |
GAIAGEO_DECLARE int gaiaIsEmpty | ( | gaiaGeomCollPtr | geom | ) |
Checks for empty Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl | ( | gaiaGeomCollPtr | geom | ) |
Checks for not-closed Rings in a Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE int gaiaIsNotClosedGeomColl_r | ( | const void * | p_data, |
gaiaGeomCollPtr | geom | ||
) |
Checks for not-closed Rings in a Geometry object.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
geom | pointer to Geometry object |
GAIAGEO_DECLARE int gaiaIsNotClosedRing | ( | gaiaRingPtr | ring | ) |
Checks for not-closed Rings.
ring | pointer to Ring object |
GAIAGEO_DECLARE int gaiaIsNotClosedRing_r | ( | const void * | p_data, |
gaiaRingPtr | ring | ||
) |
Checks for not-closed Rings.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
ring | pointer to Ring object |
GAIAGEO_DECLARE int gaiaIsPointOnPolygonSurface | ( | gaiaPolygonPtr | polyg, |
double | x, | ||
double | y | ||
) |
Checks if a Point lays on a Polygon surface.
polyg | pointer to Polygon object |
x | Point X coordinate |
y | Point Y coordinate |
GAIAGEO_DECLARE int gaiaIsPointOnRingSurface | ( | gaiaRingPtr | ring, |
double | pt_x, | ||
double | pt_y | ||
) |
Check if a Point lays on a Ring surface.
ring | pointer to Ring object |
pt_x | Point X coordinate |
pt_y | Point Y coordinate |
GAIAGEO_DECLARE int gaiaIsToxic | ( | gaiaGeomCollPtr | geom | ) |
Checks for toxic Geometry object.
geom | pointer to Geometry object |
GAIAGEO_DECLARE int gaiaIsToxic_r | ( | const void * | p_cache, |
gaiaGeomCollPtr | geom | ||
) |
Checks for toxic Geometry object.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
geom | pointer to Geometry object |
GAIAGEO_DECLARE int gaiaIsValidTrajectory | ( | gaiaGeomCollPtr | geom | ) |
Checks if a Geometry object is valid Trajectory.
geom | pointer to Geometry object |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLinearize | ( | gaiaGeomCollPtr | geom, |
int | force_multi | ||
) |
Attempts to resolve a (Multi)Linestring from a Geometry object.
geom | pointer to Geometry object. |
force_multi | 0 if the returned Geometry could represent a Linestring: any other value if casting to MultiLinestring is required unconditionally. |
GAIAGEO_DECLARE int gaiaLineGetPoint | ( | gaiaLinestringPtr | ln, |
int | v, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
double * | m | ||
) |
Gets coodinates from a Linestring's Point.
ln | pointer to Linestring object. |
v | relative position of Point: first Point has index 0 |
x | on completion this variable will contain the Point X coordinate. |
y | on completion this variable will contain the Point Y coordinate. |
z | on completion this variable will contain the Point Z coordinate. |
m | on completion this variable will contain the Point M measure. |
GAIAGEO_DECLARE int gaiaLineSetPoint | ( | gaiaLinestringPtr | ln, |
int | v, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double | m | ||
) |
Sets coordinates for a Linestring's Point.
ln | pointer to Linestring object. |
v | relative position of Point: first Point has index 0 |
x | the Point's X coordinate. |
y | the Point's Y coordinate. |
z | the Point's Z coordinate. |
m | the Point's M measure. |
GAIAGEO_DECLARE int gaiaLinestringEquals | ( | gaiaLinestringPtr | line1, |
gaiaLinestringPtr | line2 | ||
) |
Checks if two Linestring objects are equivalent.
line1 | pointer to first Linestring object. |
line2 | pointer to second Linestring object. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaLocateBetweenMeasures | ( | gaiaGeomCollPtr | geom, |
double | m_start, | ||
double | m_end | ||
) |
Return a GeometryCollection containing elements matching the specified range of measures.
geom | pointer to Geometry object |
m_start | range of measures: start value |
m_end | range of measures: end value |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeArc | ( | double | center_x, |
double | center_y, | ||
double | radius, | ||
double | start, | ||
double | stop, | ||
double | step | ||
) |
Creates a Circular Arc (Linestring) Geometry.
center_x | center point X coordinate. |
center_y | center point Y coordinate. |
radius | the circle's radius. |
start | the start angle (in degrees). |
start | the stop angle (in degrees). |
step | angular distance (in degrees) between points on the circumference. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeCircle | ( | double | center_x, |
double | center_y, | ||
double | radius, | ||
double | step | ||
) |
Creates a Circle (Linestring) Geometry.
center_x | center point X coordinate. |
center_y | center point Y coordinate. |
radius | the circle's radius. |
step | angular distance (in degrees) between points on the circumference. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakeEllipse | ( | double | center_x, |
double | center_y, | ||
double | x_axis, | ||
double | y_axis, | ||
double | step | ||
) |
Creates an Ellipse (Linestring) Geometry.
center_x | center point X coordinate. |
center_y | center point Y coordinate. |
x_axis | the ellipses's X axis. |
y_axis | the ellipses's Y axis. |
step | angular distance (in degrees) between points on the ellipse. |
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.
center_x | center point X coordinate. |
center_y | center point Y coordinate. |
x_axis | the ellipses's X axis. |
y_axis | the ellipses's Y axis. |
start | the start angle (in degrees). |
start | the stop angle (in degrees). |
step | angular distance (in degrees) between points on the ellipse. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMakePolygon | ( | gaiaGeomCollPtr | exterior, |
gaiaGeomCollPtr | interiors | ||
) |
Creates a Polygon from closed Linestrings.
exterior | a closed Linestring assumed to represent the Exterior Ring. |
interiors | one (or more than one) clsed Linestrings assumed to represent all Interior Rings (could be a Linstring or a MultiLinestring). NULL if there are no Interior Rings at all. |
GAIAGEO_DECLARE double gaiaMeasureArea | ( | gaiaRingPtr | ring | ) |
Measures the geometric area for a Ring object.
ring | pointer to Ring object |
GAIAGEO_DECLARE double gaiaMeasureLength | ( | int | dims, |
double * | coords, | ||
int | vert | ||
) |
Measures the geometric length for a Linestring or Ring.
dims | dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_ZM |
coords | pointed to COORD mem-array |
vert | number of Points (aka Vertices) within the COORD mem-array |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries | ( | gaiaGeomCollPtr | geom1, |
gaiaGeomCollPtr | geom2 | ||
) |
Merges two Geometry objects into a single one.
geom1 | pointer to first Geometry object. |
geom2 | pointer to second Geometry object. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaMergeGeometries_r | ( | const void * | p_cache, |
gaiaGeomCollPtr | geom1, | ||
gaiaGeomCollPtr | geom2 | ||
) |
Merges two Geometry objects into a single one.
p_cache | a memory pointer returned by spatialite_alloc_connection() |
geom1 | pointer to first Geometry object. |
geom2 | pointer to second Geometry object. |
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.
x0 | Point X coordinate |
y0 | Point Y coordinate |
dims | dimensions: one of GAIA_XY, GAIA_XY_Z, GAIA_XY_M or GAIA_XY_ZM |
coords | pointed to COORD mem-array |
vert | number of Points (aka Vertices) within the COORD mem-array |
GAIAGEO_DECLARE void gaiaNormalizeLonLat | ( | gaiaGeomCollPtr | geom | ) |
Shifts any coordinate to within the "normal range" of longitude and latitude values (-180.0 to 180.0 longitude and -90.0 to 90.0 latitude).
geom | pointer to Geometry object. |
GAIAGEO_DECLARE int gaiaPolygonEquals | ( | gaiaPolygonPtr | polyg1, |
gaiaPolygonPtr | polyg2 | ||
) |
Checks if two Polygons objects are equivalent.
polyg1 | pointer to first Polygon object. |
polyg2 | pointer to second Polygon object. |
GAIAGEO_DECLARE void gaiaReflectCoords | ( | gaiaGeomCollPtr | geom, |
int | x_axis, | ||
int | y_axis | ||
) |
Reflects any coordinate within a Geometry object.
geom | pointer to Geometry object. |
x_axis | if set to 0, no X axis reflection will be applied: otherwise the X axis will be reflected. |
y_axis | if set to 0, no Y axis reflection will be applied: otherwise the Y axis will be reflected. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaRemoveRepeatedPoints | ( | gaiaGeomCollPtr | org, |
double | tolerance | ||
) |
Attempts to sanitize a possibly malformed Geometry object.
org | pointer to Geometry object. |
tolerance |
GAIAGEO_DECLARE void gaiaRingCentroid | ( | gaiaRingPtr | ring, |
double * | rx, | ||
double * | ry | ||
) |
Determines the Centroid for a Ring object.
ring | pointer to Ring object. |
rx | on completion this variable will contain the centroid X coordinate. |
ry | on completion this variable will contain the centroid Y coordinate. |
GAIAGEO_DECLARE int gaiaRingGetPoint | ( | gaiaRingPtr | rng, |
int | v, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
double * | m | ||
) |
Gets coordinates from a Ring's Point.
rng | pointer to Ring object. |
v | relative position of Point: first Point has index 0 |
x | on completion this variable will contain the Point X coordinate. |
y | on completion this variable will contain the Point Y coordinate. |
z | on completion this variable will contain the Point Z coordinate. |
m | on completion this variable will contain the Point M measure. |
GAIAGEO_DECLARE int gaiaRingSetPoint | ( | gaiaRingPtr | rng, |
int | v, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double | m | ||
) |
Sets coodinates for a Ring's Point.
rng | pointer to Ring object. |
v | relative position of Point: first Point has index 0 |
x | the Point's X coordinate. |
y | the Point's Y coordinate. |
z | the Point's Z coordinate. |
m | the Point's M measure. |
GAIAGEO_DECLARE void gaiaRotateCoords | ( | gaiaGeomCollPtr | geom, |
double | angle | ||
) |
Rotates any coordinate within a Geometry object.
geom | pointer to Geometry object. |
angle | rotation angle [expressed in Degrees]. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSanitize | ( | gaiaGeomCollPtr | org | ) |
Attempts to sanitize a possibly malformed Geometry object.
org | pointer to Geometry object. |
GAIAGEO_DECLARE void gaiaScaleCoords | ( | gaiaGeomCollPtr | geom, |
double | scale_x, | ||
double | scale_y | ||
) |
Scales any coordinate within a Geometry object.
geom | pointer to Geometry object. |
scale_x | X axis scale factor. |
scale_y | Y axis scale factor. |
GAIAGEO_DECLARE void gaiaShiftCoords | ( | gaiaGeomCollPtr | geom, |
double | shift_x, | ||
double | shift_y | ||
) |
Shifts any coordinate within a Geometry object.
geom | pointer to Geometry object. |
shift_x | X axis shift factor. |
shift_y | Y axis shift factor. |
GAIAGEO_DECLARE void gaiaShiftCoords3D | ( | gaiaGeomCollPtr | geom, |
double | shift_x, | ||
double | shift_y, | ||
double | shift_z | ||
) |
Shifts any coordinate within a 3D Geometry object.
geom | pointer to Geometry object. |
shift_x | X axis shift factor. |
shift_y | Y axis shift factor. |
shift_z | Z axis shift factor. |
GAIAGEO_DECLARE void gaiaShiftLongitude | ( | gaiaGeomCollPtr | geom | ) |
Shifts negative longitudes.
geom | pointer to Geometry object. |
GAIAGEO_DECLARE void gaiaSwapCoords | ( | gaiaGeomCollPtr | geom | ) |
Swaps any coordinate within a Geometry object.
geom | pointer to Geometry object. |
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTrajectoryInterpolatePoint | ( | gaiaGeomCollPtr | geom, |
double | m | ||
) |
Attempts to interpolate a Point along a Trajectory accordingly to given M-Value.
geom | pointer to Geometry object (expected to be a valid Trajectory) |
m | the M-Value to be interpolated |
GAIAGEO_DECLARE void gaiaUpDownHeight | ( | gaiaLinestringPtr | line, |
double * | up, | ||
double * | down | ||
) |
Computes the Uphill and Downhill total Height for some 3D Linestrings.
line | a generic Linestring. |
up | on completion this variable will contain the total Uphill Height. Will always be ZERO for any 2D Linestring. |
down | on completion this variable will contain the total Downhill Height. Will always be ZERO for any 2D Linestring. |