Latest 1.2.1
Homepage https://github.com/wtw-software/UTMConversion
License MIT
Platforms ios 8.0
Authors

Carthage compatible
MIT Licence

Convert between latitude/longitude and the UTM (Universal Transverse Mercator) coordinate systems. The conversion happens between a custom struct UTMCoordinate and CoreLocation’s CLLocationCoordinate2D and CLLocation.

Requirements

  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 10+
  • Swift 4.2+

Installation

Carthage

To integrate UTMConversion into your Xcode project using Carthage, specify it in your Cartfile:

github "wtw-software/UTMConversion" ~> 1.2

CocoaPods

To integrate UTMConversion into you Xcode project using CocoaPods, specify it in you Podfile:

target 'MyApp' do
  pod 'UTMConversion', '~> 1.2'
end

Then run pod install inside your terminal, or from CocoaPods.app.

Usage

Convert to UTM

import CoreLocation
import UTMConversion

let coordinate = CLLocationCoordinate2D(latitude: 63.430493678423012, longitude: 10.394966844991798)
let utmCoordinate = coordinate.utmCoordinate()

let location = CLLocation(latitude: 63.430493678423012, longitude: 10.394966844991798)
let utmCoordinate2 = location.utmCoordinate()

Convert from UTM

import CoreLocation
import UTMConversion

let utmCoordinate = UTMCoordinate(northing: 7034313, easting: 569612, zone: 32, hemisphere: .northern)
let coordinate = utmCoordinate.coordinate()
let location = utmCoordinate.location()

Datum

It is possible to specify your own datum (polar and equitorial radius), the default value is WGS84, which is the latest revision of the WGS standard.

import CoreLocation
import UTMConversion

let utmCoordinate = UTMCoordinate(northing: 7034313, easting: 569612, zone: 32, hemisphere: .northern)
let datum = UTMDatum(equitorialRadius: 6378137, polarRadius: 6356752.3142)
let coordinate = utmCoordinate.coordinate(datum: datum)

Latest podspec

{
    "name": "UTMConversion",
    "version": "1.2.1",
    "swift_version": "5.0",
    "cocoapods_version": ">= 1.4.0",
    "summary": "Convert between latitude/longitude and the UTM coordinate system.",
    "description": "Convert between latitude/longitude and the UTM (Universal Transverse Mercator) coordinate systems.nThe conversion happens between a custom struct UTMCoordinate and CoreLocation's CLLocationCoordinate2D and CLLocation.",
    "homepage": "https://github.com/wtw-software/UTMConversion",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Peter Ringset": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/wtw-software/UTMConversion.git",
        "tag": "1.2.1"
    },
    "source_files": "UTMConversion/*.{swift,h}"
}

Pin It on Pinterest

Share This