0.4.0 • Published 2 months ago

world-grid-square v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

World Grid Square

npm version MIT licensed

The world grid square is extension of JIS X0410 worldwide.This library is utilities for the world grid square.

World grid square outlined here: https://www.fttsus.org/worldgrids/en/top-en/

Compartment type

  • 1st level 80km grid
  • 2nd level 10km grid
  • 3rd level 1km grid
  • 4th level 500m grid
  • 5th level 250m grid
  • 6th level 125m grid
  • 7th level 25m grid(extension spec)
  • 8th level 12.5m grid(extension spec)
  • 9th level 5m grid(extension spec)

Install

$ npm install world-grid-square

or

$ yarn add world-grid-square

or

$ pnpm add world-grid-square

Usage

from longitude and latitude to code

import wgs from 'world-grid-square'

const code = wgs.pointToCode(139.745433, 35.658581, 6)
// 2053393599212
console.log(code)

from code to longitude and latitude

import wgs from 'world-grid-square'

const point = wgs.codeToPoint('2053393599212')
// 139.7453125, 35.65833333333333
console.log(point)

Usage for JIS Grid Square

from longitude and latitude to jis code

import wgs from 'world-grid-square'

const code = wgs.pointToJisCode(139.745433, 35.658581, 6)
// 53393599212
console.log(code)

from jis code to longitude and latitude

import wgs from 'world-grid-square'

const point = wgs.jisCodeToPoint('53393599212')
// 139.7453125, 35.65833333333333
console.log(point)

Demo using map

Here is a demo that actually draws the world grid square on the map using this library.
https://9revolution9.com/tools/geo/geocode/

0.4.0

2 months ago

0.3.0

5 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago