Skip to content

Public search geographical place using Open Street Map Geocoding API (Node.js)

Notifications You must be signed in to change notification settings

kolegm/search-osm-geocode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##search-osm-geocoder

General

Node.js module for geocoding and reverse geocoding.
Uses service Open Street map geocoding API (Nominatim tool).

Geocoding is the process of matching address with geographic coordinates.
Reverse Geocoding is the process of matching geographic coordinates with address.

Address geocoding.
Provide an address or location and receive potential OSM geocodes.
Reverse geocoding.
Provide latitude and longitude coordinates and receive the known address information for that location.

Usage Limits.

Installation

npm install search-osm-geocode [-S]

Usage example

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

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

// you can use Open Street Map options to manage result format
var options = {
  'accept-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
geocoder.geocode(ADDRESS, callback, options);
// reverse geocoding
geocoder.reverseGeocode(LATITUDE, LONGITUDE, callback, options);

About

Public search geographical place using Open Street Map Geocoding API (Node.js)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published