1.1.3 • Published 5 years ago

points-in-country v1.1.3

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

points-in-country NPM: Build Status GitHub license

Generate an array of points within a country

Input

Parameters: (country, interval)

country requried

interval optional 0.1 by default

Output

Two dimensional array of points

[
    [lat, lon]
    [lat, lon]
    [lat, lon]
    ...
]

Usage

const pic = require('points-in-country')

const points = pic('Latvia', 0.1)

console.log(points) 
// [ 
//   [ 26.26859785200015, 55.76699086600011 ], 
//   [ 26.36859785200015, 55.76699086600011 ], 
//   [ 26.46859785200015, 55.76699086600011 ],
//   ... 
// ]

Warning

Passing an interval bigger than the longtitude or the latitude of a country will produce an empty array

eg. points-in-country('Vatican', 1) === []

Available countries

Total countries 206

AfghanistanCentral African RepublicGreenlandPalestineSouth Sudan
Akrotiri Sovereign Base AreaChadGrenadaPanamaSpain
AlandChileGuamPapua New GuineaSpratly Islands
AlbaniaChinaGuatemalaParaguaySudan
AlgeriaClipperton IslandGuernseyPeruSuriname
American SamoaColombiaGuineaPhilippinesSwaziland
AndorraComorosGuinea BissauPitcairn IslandsSweden
AngolaCook IslandsGuyanaPolandSwitzerland
AnguillaCoral Sea IslandsHaitiPortugalSyria
AntarcticaCosta RicaHeard Island and McDonald IslandsPuerto RicoTaiwan
Antigua and BarbudaCroatiaHondurasQatarTajikistan
ArgentinaCubaHong Kong S.A.R.Republic of CongoThailand
ArmeniaArubaCuraçaoHungaryRepublic of SerbiaThe Bahamas
Ashmore and Cartier IslandsCyprusIcelandRomaniaTogo
AustraliaCzech RepublicIndiaRussiaTonga
AustriaDemocratic Republic of the CongoIndian Ocean TerritoriesRwandaTrinidad and Tobago
AzerbaijanDenmarkIndonesiaSaint BarthelemyTunisia
BahrainDjiboutiIranSaint HelenaTurkey
Bajo Nuevo Bank (Petrel Is.)DominicaIraqSaint Kitts and NevisTurkmenistan
BangladeshDominican RepublicIrelandSaint Pierre and MiquelonTurks and Caicos Islands
BarbadosEast TimorIsle of ManSaint Vincent and the GrenadinesTuvalu
Baykonur CosmodromeEcuadorIsraelSamoaUganda
BelarusEgyptItalySan MarinoUkraine
BelgiumEl SalvadorIvory CoastSao Tome and PrincipeUnited Arab Emirates
BelizeEquatorial GuineaJamaicaSaudi ArabiaUnited Kingdom
BeninEritreaJapanScarborough ReefUnited Republic of Tanzania
BermudaEstoniaJerseySenegalUnited States Minor Outlying Islands
BhutanEthiopiaJordanSerranilla BankUnited States of America
BoliviaFalkland IslandsKazakhstanSeychellesUnited States Virgin Islands
Bosnia and HerzegovinaFaroe IslandsKenyaSiachen GlacierUruguay
BotswanaFederated States of MicronesiaKiribatiSierra LeoneUS Naval Base Guantanamo Bay
BrazilFijiKosovoSingaporeUzbekistan
British Indian Ocean TerritoryFinlandKuwaitSint MaartenVanuatu
British Virgin IslandsFranceKyrgyzstanSlovakiaVatican
BruneiFrench PolynesiaLaosSloveniaVenezuela
BulgariaFrench Southern and Antarctic LandsLebanonSolomon IslandsVietnam
Burkina FasoGabonLiberiaSomaliaWallis and Futuna
BurundiGambiaLibyaSomalilandWestern Sahara
CambodiaGeorgiaNorthern CyprusSouth AfricaYemen
CameroonGermanyNorth KoreaSouth Georgia and South Sandwich Islands
CanadaGhanaOmanSouth Korea
Cape VerdeGibraltarPakistanZambia
Cayman IslandsGreecePalauZimbabwe

License

MIT License

Copyright (c) 2019 Tomasz Zielinski

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.