unicef/magicbox-latlon-admin-server

Name: magicbox-latlon-admin-server

Owner: unicef

Description: API that takes latitude/longitude pairs and returns an ID and metadata for the administrative boundaries they're located within

Created: 2017-10-26 03:28:40.0

Updated: 2018-05-16 18:35:46.0

Pushed: 2018-05-16 18:35:44.0

Homepage:

Size: 100

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Latitude/longitude coordinates to admin ID server

Chat on Gitter Build Status

This is a component of Magic Box

API that takes latitude/longitude pairs and returns an ID and metadata for the administrative boundaries they're located within

screenshot

Example
curl http://localhost:8082/api/coordinates/33.385586,66.445313
returns …

so": "AFG",
ame_0": "Afghanistan",
ame_1": "Daykundi",
ame_2": "Gizab",
dmin_id": "afg_1_6_53_gadm2-8",
on": 66.445313,
at": 33.385586

Dependencies:
NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
Node.js
nvm install 8
Prerequisites
Setup
git clone https://github.com/unicef/coordinates_to_admin_id_server
cd coordinates_to_admin_id_server
cp config-sample.js config.js
npm install
npm run build
Batch example

curl http://localhost:8082/api/coordinates/33.385586,66.445313,-16.351768,-45.703125

Note to pairs of coordinates in the url. This returns:


"iso": "AFG",
"name_0": "Afghanistan",
"name_1": "Daykundi",
"name_2": "Gizab",
"admin_id": "afg_1_6_53_gadm2-8",
"lon": 66.445313,
"lat": 33.385586


"iso": "BRA",
"name_0": "Brazil",
"name_1": "MinasGerais",
"name_2": "Riachinho",
"name_3": "Riachinho",
"admin_id": "bra_33_13_2179_4369_gadm2-8",
"lon": -45.703125,
"lat": -16.351768



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.