0.0.3 • Published 7 years ago

ichibin v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

ichibin

Ichibin is a Node.js library to convert location (longitude and latitude) to address. It currently supports Japan only.

Currently, the following features are supported:

  • Using MongoDB for data backend
  • Downloading MLIT data for reverse-geocoding

Installation

$ npm install --save ichibin

or

$ yarn add ichibin

Usage

To use ichibin for reverse-geocoding, you need to seed data:

$ ./node_modules/.bin/ichibin seed

Then, you can do reverse-geocoding:

const Ichibin = require('ichibin');
const ichibin = new Ichibin();
const lon = 141.321212;
const lat = 43.037301;

ichibin.getAddress(lon, lat).then((result) => console.log(result));

# > { dis: 0,
#   obj:
#    { _id: 58f89934cbbdef0404478c5e,
#      prefecture: '北海道',
#      city: '札幌市中央区',
#      town: '旭ケ丘五丁目',
#      street: 5,
#      coordinate: 12,
#      x: -106529.3,
#      y: -75681.1,
#      addressed: 1,
#      represented: 1,
#      update_flag1: 0,
#      update_flag2: 0,
#      ll: [ 141.321212, 43.037301 ] } }

Address data

The library uses the following data:

License

Copyright © 2017 Naoto Yokoyama

Distributed under the MIT license. See the LICENSE file for full details.