Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including pelias-hierarchy-lookup with all npm packages installed. Try it out:

var peliasHierarchyLookup = require("pelias-hierarchy-lookup")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

pelias-hierarchy-lookup v0.0.6

Query for performing multi-layer polygon intersection queries

NPM

This module status is currently beta, the API may change in the future.

The functionality and parameters are specific to Pelias, only use this module if you know what you're doing.

This requires that the quattroshapes data has already been imported and the indeces have been refreshed and ready for querying

Installation

$ npm install pelias-hierarchy-lookup

Usage

var lookup = require('pelias-hierarchy-lookup'),
    stream = lookup.stream(),
    through = require('through2');

stream.pipe( through.obj( function( item, enc, next ){
  console.log( item );
  next();
}));

var centroid = { lat: 51.5328850, lon: -0.0652280 };
stream.write({ center_point: centroid } );
stream.end();

options

The stream() constructor accepts an options object, which configures the behavior of the lookup and may contain any of the following keys:

  • prop: by default the stream looks for an object containing lat/lon keys in a property called center_point; a different property name can be specified here.
  • logLevel: the minimum level of log messages that the underlying logger, Winston, will print to the console. Defaults to error; see all possible options.

NPM Module

The pelias-hierarchy-lookup npm module can be found here:

https://npmjs.org/package/pelias-hierarchy-lookup

Contributing

Please fork and pull request against upstream master on a feature branch.

Pretty please; provide unit tests and script fixtures in the test directory.

Running Unit Tests

$ npm test

Continuous Integration

Travis tests every release against node version 0.10

Build Status

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free