latlongify

1.0.2 • Public • Published

latlongify

A simple utility to lookup a lat/long pair and tell you:

  • which country it is in
  • which UK county it is in (if in the UK)
  • which US state it is in (if in the USA)
  • the nearest UK town/city (if in the UK)

Installation

npm install --save latlongify

Usage

const latlongify = require('latlongify')
const r = await latlongify.find(52.4226, 0.01) // latitude & longitude
console.log(r)
// {
//   country: { name: 'United Kingdom', code: 'GBR', group: 'Countries' },
//   state: undefined,
//   county: { name: 'Cambridgeshire', group: 'UK Counties' },
//   city: { name: 'Somersham', lat: 52.3823, long: 0.0006 }
// }

Readme

Keywords

Package Sidebar

Install

npm i latlongify

Weekly Downloads

37

Version

1.0.2

License

Apache-2.0

Unpacked Size

13.9 MB

Total Files

4

Last publish

Collaborators

  • glynnbird