Documentation for maplib/Geometry.kt
- data class Point
Point class. Holds X and Y coordinates.
- class CoordinateTransformation
Coordinate transformation class. Helps to transform from one spatial reference to another.
- static fun new(fromEPSG: Int, toEPSG: Int) : CoordinateTransformation
Create new coordinate transformation.
- Parameters
fromEPSG – Source EPSG spatial reference code.
toEPSG – Destination EPSG spatial reference code.
- Returns
CoordinateTransformation class instance.
- data class Envelope
Spatial envelope.
- fun constructor(minX: Double = 0.0, maxX: Double = 0.0, minY: Double = 0.0, maxY: Double = 0.0)
Main constructor
- Parameters
minX – X Minimum X value.
maxX – X Maximum X value.
minY – Y Minimum Y value.
maxY – Y Maximum X value.
- fun 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.
- class Geometry
Geometry class.
- fun constructor(handle: Long)
Main constructor
- Parameters
handle – e C API handle
- static fun typeToName(geometryType: Type) : String
Get name from geometry type.
- Parameters
geometryType – Geometry type.
- Returns
Geometry type name string.
- static fun createFromJson(json: JsonObject) : Geometry?
Create geometry from json object. The GeoJson geometry part.
- Parameters
json – JsonObject class instance.
- Returns
Geometry or null.
- fun transform(toEPSG: Int) : Boolean
Transform geometry from one spatial reference to another.
- Parameters
epsg – Destination spatial reference.
- Returns
True on success.
- fun transform(transformation: CoordinateTransformation) : Boolean
Transform geometry from one spatial reference to another.
- Parameters
transformation – CoordinateTransformation class instance.
- Returns
True on success.
- enum class Type
Geometry type.
NONE = 0 : No geometry.
POINT = 1 : Point.
LINESTRING = 2 : Linestring.
POLYGON = 3 : Polygon.
MULTIPOINT = 4 : Multipoint.
MULTILINESTRING = 5 : Multilinestring.
MULTIPOLYGON = 6 : Multipolygon.
- class GeoPoint
Geometry point class.