• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ—บ Get the ISO 3166-1 alpha-3 country code from geographic coordinates.

country-iso

Travis CI Codecov npm npm version npm dependencies npm dev dependencies

๐Ÿ—บ Get ISO 3166-1 alpha-3 country code from geographic coordinates.

Click on the map to see a live preview.

Synopsis

Given the latitude and longitude coordinates this package returns the country code of the country in which the coordinates fall into.

The package internally uses @geo-maps/countries-maritime map with 10m resolution to give you the right country code. The accuracy of the map has been tested with 23785 cities but the demo allows you to actually test it manually by just clicking on the map to see what it returns.

Do you believe that this is useful? If so, support us with a โญ๏ธ!

Install

$ npm install --save country-iso

Usage

You can query any (lat,lng) pair on the earth. It also works for territorial waters and disputed countries.

const countryIso = require('country-iso');

// Query a point in Italy.
countryIso.get(41.9028, 12.4964);
// => ['ITA']

// Query a disputed country.
countryIso.get(24, -14);
// => ['ESH', 'MAR']

// Query a point somewhere in Atlantic Ocean.
countryIso.get(40, -40);
// => []

API

get(lat, lng) โ‡’ Array.<string>

Searches for every country which contains the point (lat, lng).

Returns: Array.<string> - Array of ISO 3166 alpha-3 country code for the geographic coordinates.

Param Type Description
lat number The latitude of the point.
lng number The longitude of the point.

Related

  • is-sea: ๐ŸŒŠ Check whether a geographic coordinate is in the sea or not on the earth.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

More Repositories

1

geo-maps

๐Ÿ—บ High Quality GeoJSON maps programmatically generated.
JavaScript
1,265
star
2

upash

๐Ÿ”’Unified API for password hashing algorithms
JavaScript
536
star
3

sympact

๐Ÿ”ฅ Stupid Simple CPU/MEM "Profiler" for your JS code.
JavaScript
439
star
4

lm-scorer

๐Ÿ“ƒLanguage Model based sentences scoring library
Python
299
star
5

datasets-knowledge-embedding

๐Ÿ“ A collection of common datasets used in knowledge embedding
Shell
145
star
6

pidtree

๐Ÿšธ Cross platform children list of a PID.
JavaScript
124
star
7

geojson-geometries-lookup

โšก๏ธ Fast geometry in geometry lookup for large GeoJSONs.
JavaScript
90
star
8

is-sea

๐ŸŒŠ Check whether a geographic coordinate is in the sea or not on the earth.
JavaScript
49
star
9

osm-geojson

๐Ÿ”ฐ Get GeoJSON of a OpenStreetMap's relation from the API.
JavaScript
49
star
10

fitbit2garmin

โฌ‡ Downloads lifetime Fitbit data and exports it into the format supported by Garmin Connect data importer. This includes historical body composition data (weight, BMI, and fat percentage), activity data (calories burned, steps, distance, active minutes, and floors climbed), and individual GPS exercises (TCX).
Python
38
star
11

env-dot-prop

โ™ป๏ธ Get, set, or delete nested properties of process.env using a dot path
JavaScript
33
star
12

roboprime

๐Ÿค– Full featured 21 DOF 3D Printed Humanoid Robot based on ATmega328P chip
Arduino
27
star
13

competitive-programming

๐Ÿ… This repository contains all the problems I solved while training myself for programming competitions
C++
21
star
14

phc-argon2

๐Ÿ”’ Node.JS Argon2 password hashing algorithm following the PHC string format.
JavaScript
17
star
15

phc-format

๐Ÿ“ PHC String Format implementation for Node.JS
JavaScript
17
star
16

upash-cli

๐ŸŒŒ Hash password directly from your terminal
JavaScript
15
star
17

ni

๐Ÿ“ฆ A better `npm init` **NOT RELEASED**
JavaScript
12
star
18

phc-pbkdf2

๐Ÿ”’ Node.JS PBKDF2 password hashing algorithm following the PHC string format.
JavaScript
12
star
19

osm-countries

๐Ÿ”Ž Get the OpenStreetMap's relation id from a country code.
JavaScript
11
star
20

varname-seq2seq

๐Ÿ“„Source code variable naming using a seq2seq architecture
Python
10
star
21

project-version

๐Ÿ‘€ Get the current version of your project.
JavaScript
10
star
22

fever-transformers

๐Ÿ“„ Evidence Retrieval and Claim Verification for the FEVER shared task using Transformer Networks
Python
10
star
23

bin-manager

๐ŸŒ€ Binaries available as local nodeJS dependencies
JavaScript
8
star
24

leadoii

๐Ÿ† Leaderboard Generator for the Italian Olympiads of Informatics Training Platform
Vue
8
star
25

phc-scrypt

๐Ÿ”’ Node.JS scrypt password hashing algorithm following the PHC string format.
JavaScript
6
star
26

phc-bcrypt

๐Ÿ”’ Easy to use Unified API for bcrypt password hashing algorithm
JavaScript
6
star
27

act

โœ๏ธ Multi-purpose URI tracker.
JavaScript
6
star
28

tsse

โฑ Timing safe string equals.
JavaScript
3
star
29

restify-errors-options

๐Ÿ”ง Add custom options to Restify's errors
JavaScript
3
star
30

text-tokenizers-colab

๐Ÿ”ช Tokenize text on the fly on Colab.
Jupyter Notebook
3
star
31

leadoii-static

๐Ÿ…Pre-Generated Leaderboards of the Italian Olympiads of Informatics Training Platform Users
HTML
3
star
32

sudoku-solver

๐Ÿ”ข Sudoku Solutions Enumerator (Sequential and Parallel)
Java
2
star
33

text2error

ใ€ฐ Introduce errors in error free text
Python
2
star
34

restify-errors-thrower

๐Ÿ’ฅ Throw Restify errors easily!
JavaScript
2
star
35

kdf-salt

๐ŸŽฒ Crypto secure salt generator
JavaScript
2
star
36

docker-osrm-backend

๐Ÿ›ฃ The Open Source Routing Machine Docker ready!
Shell
2
star
37

geojson-geometries

โ› Extract elementary geometries from a GeoJSON inheriting properties.
JavaScript
2
star
38

css-viewport-units-cross-browser

Cross-Browser CSS3 Viewport Units: (vh, vw, vmin, vmax)
CSS
2
star
39

talking-unicorn

๐Ÿฆ„ An Arduino based greating unicorn.
Arduino
2
star
40

edgelist-mapper

๐Ÿ“ŠMaps nodes and edges of a multi-relational graph to integer
Python
1
star
41

ardutank

๐Ÿš— An Arduino based rover
C++
1
star
42

rgcn-link-prediction-experiments

1
star
43

restify-errors-options-errno

โ˜Ž๏ธ Add errno to Restify's errors
JavaScript
1
star