@tomgp/whereis
v1.15.0
Published
Given a `[long, lat]` coordinate return a JSON object indicating which if any of the following types of area it is within and the specifica areas in question
Downloads
98
Readme
DON'T USE THIS IN BROWSER AS IT INCLUDES A WHOLE BUNCH OG GEO DATA AND ITS NOT OPTIMISED IN ANY WAY
Given a [longitude, latitude]
coordinate (array, IN THAT ORDER) return a JSON object indicating with information about the areas within which is contained...
{
wgi: <IPPC WGI REGION>,
wmo: <WMO REGION> // not yet
country: {
name: <NAME>
iso2: <2 LETTER ISO CODE>
iso3: <3 LETTER ISO CODE>
isosubregion: <ISO SUB-REGION>
isoregion: <ISO-REGION>
},
}
install npm i @tomgp/whereis'
import whereis from '@tomgp/whereis';
const details = whereis.location([0,53]);
console.log(details);
output...
{
point: [ 0, 53 ],
WGI: {
continent: 'EUROPE',
regionType: 'Land',
regionName: 'N.Europe',
regionAcronym: 'NEU',
regionID: '16'
},
country: {
administrativeName: 'United Kingdom',
ISO2: 'GB',
ISO3: 'GBR',
isoRegion: 'Europe',
isoSubRegion: 'Northern Europe'
}
}
TODO
- Check all iso3 centroids i.e. get all the cetroids, put them into the locaiotn function and check that they match the returned iso3 value
- Sort out France, French Guiana etc with respect to WGI regions