npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

coordconv

v1.0.1

Published

Coordinate System Interchange Transformation Algorithm for TM,WTM,CONGNAMUL,WCONGNAMUL,KTM,WKTM,UTM,WGS84,BESSEL

Downloads

30

Readme

coordconv

  • Translates coordinate systems to and from each other. The coordinate system has the code below.
  • 좌표계를 상호 변환합니다. 좌표계는 아래와 같은 코드를 가지고 있습니다.

| Coord | Code | note | |----------|----|----| |TM | 0| | |WTM | 1| | |CONGNAMUL | 2| | |WCONGNAMUL| 3|Kakao Map| |KTM | 4| | |WKTM | 5| | |UTM | 6| | |WGS84 | 7|Google Map, Naver Map| |BESSEL | 8| |

How to Use

// let kk = coordconv(x, y, from, to)
//
// x : X axis of the coordinate system (ex:longitude)
//     좌표계의 X축 (예:경도)
// y : Y axis of the coordinate system (ex:latitude)
//     좌표계의 Y축 (예:위도)
// from : coordinate system code(from)
//        변환 대상 좌표계 코드
// to : coordinate system code(to)
//      변환 할 좌표계 코드
//
// return : transformed coordinates x,y (Array)
//          변환된 좌표의 x,y (배열)
let kk = coordconv(126.9876757,37.5611523,7,3)
// convert WGS84[7] (126.9876757,37.5611523) to WCONGNAMUL[3]
// WGS84 좌표계[7]의 좌표(126.9876757,37.5611523)를 WCONGNAMUL좌표계[3]로 변환한다.

console.log(kk) // [ 497278, 1128228 ]

Example

  • Test code that converts WGS84 coordinates to other coordinates and back to WGS84 coordinates
  • WGS84 좌표를 다른 좌표로 변환하고, 다시 WGS84 좌표로 변환시키는 테스트코드
for ( let k =0 ; k < 9; k++ ) {
    console.log(k)
    let kk = coordconv(126.9876757,37.5611523,7,k)
    coordconv(kk[0],kk[1],k,7)
}
[RESULT]
0
WGS84(126.9876757,37.5611523) => TM(198841.46164981902,450986.185504335)
TM(198841.46164981902,450986.185504335) => WGS84(126.98767573415425,37.561152277544274)
1
WGS84(126.9876757,37.5611523) => WTM(198911.11067044004,451291.3401759742)
WTM(198911.11067044004,451291.3401759742) => WGS84(126.98767576830853,37.56115225508858)
2
WGS84(126.9876757,37.5611523) => CONGNAMUL(497104.15412454755,1127465.9637608374)
CONGNAMUL(497104.15412454755,1127465.9637608374) => WGS84(126.98767799744235,37.56115407978852)
3
WGS84(126.9876757,37.5611523) => WCONGNAMUL(497278,1128228)
WCONGNAMUL(497278,1128228) => WGS84(126.98767677956626,37.56115099221307)
4
WGS84(126.9876757,37.5611523) => KTM(310758.5256985903,551470.6070910962)
KTM(310758.5256985903,551470.6070910962) => WGS84(126.98767573415425,37.561152277544274)
5
WGS84(126.9876757,37.5611523) => WKTM(310565.56662535225,551777.8079165379)
WKTM(310565.56662535225,551777.8079165379) => WGS84(126.98767576830853,37.56115225508856)
6
WGS84(126.9876757,37.5611523) => UTM(322266.19235843327,4159028.8981151287)
UTM(322266.19235843327,4159028.8981151287) => WGS84(126.9876757683075,37.561152255088565)
7
WGS84(126.9876757,37.5611523) => WGS84(126.9876757,37.5611523)
8
WGS84(126.9876757,37.5611523) => BESSEL(126.98977663059763,37.5583554353612)
BESSEL(126.98977663059763,37.5583554353612) => WGS84(126.98767573415425,37.561152277544274)

test code - node.js

const coordconv = require('coordconv')
let kk = coordconv(126.9876757,37.5611523,7,3)
console.log(kk)

test code - web browser

<script type="text/javascript" src="coordconv.js"></script>
<script>
    let kk = coordconv(126.9876757,37.5611523,7,3)
    console.log(kk)
</script>