Documentation for MapLib/Geometry.swift¶
- class CoordinateTransformation¶
Coordinate transformation class. Helps to transform from one spatial reference to another.
- static func new(fromEPSG: Int32, toEPSG: Int32) CoordinateTransformation ¶
Create new coordinate transformation.
- Parameters
fromEPSG – Source EPSG spatial reference code.
toEPSG – Destination EPSG spatial reference code.
- Returns
CoordinateTransformation class instance.
Spatial envelope.
- init(minX: Double, minY: Double, maxX: Double, maxY: Double)¶
Init envelope with values.
- Parameters
minX – Minimum X coordinate.
minY – Minimum Y coordinate.
maxX – Maximum X coordinate.
maxY – Maximum Y coordinate.
- init()¶
Init envelope with zeroo coordinates. Envelope will be invalid.
- func merge(other: Envelope)¶
Merge envelope with other envelope. The result of extent of this and other envelop will be set to this envelope.
- Parameters
other – Other envelope.
- func increase(by value:Double)¶
Increase envelope by value.
- Parameters
value – Value to increase width and height of envelope. May be negative for decrease sizes.
- class Geometry¶
Geometry class.
- var type : GeometryType¶
Geometry type.
- func transform(to epsg:Int32) Bool ¶
Transform geometry from one spatial reference to another.
- Parameters
epsg – Destination spatial reference.
- Returns
True on success.
- func transform(_ transformation:CoordinateTransformation) Bool ¶
Transform geometry from one spatial reference to another.
- Parameters
transformation – CoordinateTransformation class instance.
- Returns
True on success.
Geometry point class.