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

kma-grid

v1.0.3

Published

Library to convert latitude longitude coordinates to KMA Grid coordinates

Downloads

13

Readme

kma-grid

kma-grid는 위도와 경도를 Lambert Conformal Conic Projection을 사용하여 격자 좌표로 변환하는 자바스크립트 라이브러리입니다. 이 라이브러리는 기상청 API에서 격자X, Y를 사용할 때 유용합니다.

기상청 API 문서 내에 C언어로 된 격자 변환 코드를 자바스크립트로 변환한 코드입니다.

설치

라이브러리는 npm을 사용하여 쉽게 설치할 수 있습니다:

npm install kma-grid

사용 방법

라이브러리를 사용하기 위해, Coordinate 클래스를 임포트하고 위도 및 경도 값을 인자로 전달하여 인스턴스를 생성합니다. 그 후, gridXgridY 프로퍼티를 사용하여 격자 좌표를 얻을 수 있습니다.

import Coordinate from 'kma-grid'

const coord = new Coordinate(37.565, 126.9780);

console.log('Grid X:', coord.gridX);
console.log('Grid Y:', coord.gridY);

이후 package.json에 다음 항목을 추가합니다.

"type": "module",

이런식으로 추가하면 됩니다.

{
  "name": "testmodule",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "type": "module",
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "kma-grid": "^1.0.0"
  }
}

API

new Coordinate(latitude, longitude)

  • latitude (Number) - 위도 (degrees)
  • longitude (Number) - 경도 (degrees)

Coordinate.gridX

  • 격자 X 좌표를 반환합니다.

Coordinate.gridY

  • 격자 Y 좌표를 반환합니다.

라이선스

이 프로젝트는 MIT 라이선스를 사용합니다. 라이선스에 대한 자세한 정보는 라이선스 파일을 참고해주세요.

기여

기여를 원하시면, 프로젝트의 GitHub 저장소에 pull request를 보내주시거나 이슈를 등록해주세요.