-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGISTool.swift
More file actions
29 lines (20 loc) · 1.04 KB
/
GISTool.swift
File metadata and controls
29 lines (20 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#if canImport(CoreLocation)
import CoreLocation
#endif
/// Some constants used in this library.
public enum GISTool {
/// WGS84 equatorial radius as specified by the International Union of Geodesy and Geophysics.
public static let equatorialRadius: CLLocationDistance = 6_378_137
/// The radius of the earth, in meters.
public static let earthRadius: CLLocationDistance = 6_371_008.8
/// Length of the equator, in meters.
public static let earthCircumference: CLLocationDistance = 40_075_016.6855785
/// Mercator projection origin shift.
public static let originShift = 2.0 * Double.pi * GISTool.equatorialRadius / 2.0 // 20037508.342789244
/// The accuracy for testing what is equal (μm precision, mainly to counter small rounding errors).
public static let equalityDelta: Double = 1e-10
/// The length in pixels of a map tile.
public static let tileSideLength: Double = 256.0
/// The default precision for encoding/decoding Polylines.
public static let defaultPolylinePrecision: Double = 1e5
}