0.0.10 • Published 10 years ago

search-geonames v0.0.10

Weekly downloads
42
License
ISC
Repository
github
Last release
10 years ago

##search-geonames

General

Node.js module for geocoding and reverse geocoding.
Uses service Geonames geocoding API.

Geocoding. Geonames API - search by query.
It is the process of matching address with geographic coordinates.
Response example.

Reverse Geocoding. Geonames API - findNearBy.
It is the process of matching geographic coordinates with address.
Response example.

Wikipedia, search data by query about location.
Geonames API - Wikipedia fulltext search.
Response example.

Wikipedia, search data by coordinates about location.
Geonames API - find nerby Wikipedia Entries.
Response example.

Output format like JSON.

Usage Limits

Installation

npm install search-geonames -S

Usage example

// initialize geocoder instance
var geonames = require('search-geonames');

// request parameters
const ADDRESS = 'Kyiv, Khreshchatyk';
const LATITUDE = '50.45';
const LONGITUDE = '30.523';
const LANGUAGE = 'en';

// you can use Geonames options to manage result format
var options = {
  language: LANGUAGE
};

// use callback to return result from geocoding process
function callback (error, result) {
  if (error) console.log(error); // on error
  else console.log(result); // on success
}

// address geocoding
geonames.searchByQuery(ADDRESS, callback, options);
// reverse geocoding
geonames.findNearBy(LATITUDE, LONGITUDE, callback, options);
// get wiki data by address
communicator.wikiSearchByQuery(ADDRESS, callback, options);
// get wiki data by geographic coordinates
communicator.wikiFindNearBy(LATITUDE, LONGITUDE,  callback,  options);
0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago