grid-cell

Crates.iogrid-cell
lib.rsgrid-cell
version0.0.2
sourcesrc
created_at2021-10-31 10:13:47.466168
updated_at2021-10-31 10:36:45.020152
descriptionLibrary for Japanese traditional grid cell.
homepage
repositoryhttps://github.com/x7c1/grid-cell
max_upload_size
id474656
size10,722
Aida.t (x7c1)

documentation

README

Grid-Cell

Library for Japanese traditional geometry standard aka "地域メッシュ" or "標準地域メッシュ".

Usage

let spot = Spot::new(Coordinate {
    longitude: 139.733231,
    latitude: 35.680916,
});

// 1次メッシュの地域メッシュコード
let actual = spot.as_first_cell().code;
let expected = 5339;
assert_eq!(actual, expected);

// 2次メッシュの地域メッシュコード
let actual = spot.as_second_cell().code;
let expected = 533945;
assert_eq!(actual, expected);

// 3次メッシュの地域メッシュコード
let actual = spot().as_third_cell().code;
let expected = 53394518;
assert_eq!(actual, expected);

// 4次メッシュ (2分の1地域メッシュ) の地域メッシュコード
let actual = spot.as_fourth_cell().code;
let expected = 533945184;
assert_eq!(actual, expected);
Commit count: 2

cargo fmt