Coder Social home page Coder Social logo

84park / utmconversion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wtw-software/utmconversion

0.0 0.0 0.0 51 KB

Convert between latitude/longitude and the UTM coordinate system.

License: MIT License

Ruby 3.60% Objective-C 1.68% Swift 94.72%

utmconversion's Introduction

UTMConversion

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 12.0+ / macOS 10.10+

Installation

Carthage

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

github "wtw-software/UTMConversion" ~> 1.4

CocoaPods

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

target 'MyApp' do
  pod 'UTMConversion', '~> 1.4'
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)

utmconversion's People

Contributors

peterringset avatar 84park avatar makslevental avatar yenoss avatar tobisaninfo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.