@znetstar/etomon-location
v2.0.0
Published
Client/Server library for querying locations
Downloads
4
Readme
Etomon Location
Etomon Location provides a client/server for getting location information (like country code, or timezone) given inputs like coordinates (lat/lng), a keyword (like "New York City"), or an IP Address.
The project provides the address resolver (api/server/GeoResolver
) along with express routes (api/server/routes
)
that exposes a JSON RPC interface to interact with the library remotely.
A client implementation is also provided (api/client/GeoClient
) that runs in the browser or in node.
Requirements
This library has two external dependencies
- Access to the Google Places, Geocoding, Timezone and Autocomplete APIs. This service is not free.
- The Maxmind GeoIP City database, which is available for free with registration.
The Places API is needed to make sense of addresses and coordinates, the Geocoding API for timezone data, the Autocomplete API for places autocomplete, and GeoIP to get location data from IP addresses.
Caching
An instance of LevelUp can be passed into the GeoResolver
constructor to cache results. This practice is disallowed
by the Google Places API Terms of Service. The functionality is included for testing purposes only, using it in production
violates the Google Places API Terms of Service.
Documentation
Documentation can be generated by running npm run docs
and opening docs/index.html
or by visiting the GitHub pages
for this project.
Testing
Tests are written in mocha, run with npm test
.
You'll need to set the GOOGLE_API_KEY
and GEO_IP_CITY_PATH
env variables with the resources described above.
License
This project is licensed under the GNU LGPL-3.0 a copy of which can be found in LICENSE.txt
.