GithubHelp home page GithubHelp logo

utm's Introduction

utm

Bidirectional UTM-WGS84 converter for JavaScript.

npm version Travis

Translated directly from Tobias Bieniek's implementation in Python.

Usage

var utm = require('utm')

utm.toLatLon(easting, northing, zoneNum, zoneLetter, northern, strict = true)

Convert from UTM-WGS84 to latitude/longitude coordinates. One and only one of zoneLetter and northern must be specified. strict option specifies whether easting and northing are checked against their respective ranges.

Returns { latitude, longitude }.

utm.fromLatLon(latitude, longitude[, zoneNum])

Convert from latitude/longitude coordinates to UTM-WGS84. zoneNum can be set to force a specific zone number.

Returns { easting, northing, zoneNum, zoneLetter }.

utm's People

Contributors

danielsiwiec avatar timothygu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

utm's Issues

Invalid zoneNum for longitude = 180

Appears it's been 5 years or so since this code was last touched. In the case it's still being maintained...

  • latLonToZone() returns either zone 1 and 61 for longitudes -180 and 180, respectively. It should return zone 1 for both values.
  • the easting returned from fromLatLong() depends on the current behavior of latLonToZone(); fixing the latter breaks the former.

Thanks ;)

utm.toLatLon: unable to use "northern" without "zoneLetter" (undefined is not false)

To reproduce:

โ€“ call utm.toLatLon(easting, northing, 55, undefined, false) and you get
โ€“ "Error: either zone_letter or northern needs to be set"

This is despite the fact that northern in fact is set, but to false. The error seems to be caused by an incorrect translation from Python's if not zone_letter and northern is None: my understanding is that we must check to see if northern is undefined.

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.