• Stars
    star
    142
  • Rank 250,271 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 6 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,225
star
2

upash

πŸ”’Unified API for password hashing algorithms
JavaScript
529
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
296
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
88
star
8

osm-geojson

πŸ”° Get GeoJSON of a OpenStreetMap's relation from the API.
JavaScript
48
star
9

is-sea

🌊 Check whether a geographic coordinate is in the sea or not on the earth.
JavaScript
46
star
10

env-dot-prop

♻️ Get, set, or delete nested properties of process.env using a dot path
JavaScript
33
star
11

roboprime

πŸ€– Full featured 21 DOF 3D Printed Humanoid Robot based on ATmega328P chip
Arduino
23
star
12

competitive-programming

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

phc-argon2

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

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
16
star
15

upash-cli

🌌 Hash password directly from your terminal
JavaScript
15
star
16

phc-format

πŸ“ PHC String Format implementation for Node.JS
JavaScript
14
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

project-version

πŸ‘€ Get the current version of your project.
JavaScript
10
star
21

fever-transformers

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

varname-seq2seq

πŸ“„Source code variable naming using a seq2seq architecture
Python
9
star
23

leadoii

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

bin-manager

πŸŒ€ Binaries available as local nodeJS dependencies
JavaScript
7
star
25

phc-bcrypt

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

phc-scrypt

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

act

✏️ Multi-purpose URI tracker.
JavaScript
6
star
28

tsse

⏱ Timing safe string equals.
JavaScript
3
star
29

text-tokenizers-colab

πŸ”ͺ Tokenize text on the fly on Colab.
Jupyter Notebook
3
star
30

restify-errors-options

πŸ”§ Add custom options to Restify's errors
JavaScript
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

restify-errors-thrower

πŸ’₯ Throw Restify errors easily!
JavaScript
2
star
34

kdf-salt

🎲 Crypto secure salt generator
JavaScript
2
star
35

docker-osrm-backend

πŸ›£ The Open Source Routing Machine Docker ready!
Shell
2
star
36

geojson-geometries

⛏ Extract elementary geometries from a GeoJSON inheriting properties.
JavaScript
2
star
37

css-viewport-units-cross-browser

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

talking-unicorn

πŸ¦„ An Arduino based greating unicorn.
Arduino
2
star
39

text2error

γ€° Introduce errors in error free text
Python
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

restify-errors-options-errno

☎️ Add errno to Restify's errors
JavaScript
1
star
43

rgcn-link-prediction-experiments

1
star