🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

country-reverse-geocoding

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-reverse-geocoding

Node.js reverse geocoding for countries & us states

0.2.2
latest
Source
npm
Version published
Weekly downloads
3.3K
39.48%
Maintainers
1
Weekly downloads
 
Created
Source

country-reverse-geocoding

NodeJS module to reverse geocoding of countries.

Installation

npm install country-reverse-geocoding

How it works

The only method of this module is get_country:

get_country(lat, lng)

Where lat and lng are the latitude and longitude of the point to be reverse-geocoded. get_country returns:

  • an Error if something went wrong
  • null if the point is not in any country
  • an object with two attributes: code, the country code, and name, the English name of this country
var crg = require('country-reverse-geocoding').country_reverse_geocoding();

var country = crg.get_country(47.3, 0.7);

console.log(country.name); // France

Tests

Install jasmine-node:

npm install jasmine-node -g

Then run

jasmine-node spec/

More information

The GeoJSON specification: http://www.geojson.org/ The GeoJSON file used in this module comes from https://github.com/johan/world.geo.json

License

Distributed under the MIT License.

Keywords

reverse

FAQs

Package last updated on 07 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts