Skip to content

nextzen/pip-service

 
 

Repository files navigation

This repository is part of the Pelias project. Pelias is an open-source, open-data geocoder built by Mapzen that also powers Mapzen Search. Our official user documentation is here.

Pelias Point-in-Polygon Service

Greenkeeper badge

Travis CI Status Gitter Chat

Overview

This service provides Who's on First-based point-in-polygon lookup functionality.

Installation

$ git clone [email protected]:pelias/pip-service.git
$ cd pip-service
$ npm install

NPM

NPM Module

The pelias-pip-service npm module can be found here:

https://npmjs.org/package/pelias-pip-service

Usage

To start the PiP service, type: npm start. By default, the service starts on port 3102. It will look for Who's on First data in the place configured in pelias.json.

Requests are made to the endpoint in the format: http://localhost:3102/<lon>/<lat>.

For example: http://localhost:3102/-106.937/34.060

Downloading data

Because pelias/whosonfirst is a dependency of this package, its downloader can be used:

npm run download

This will download Who's on First data using the same configuration options from pelias.json as the whosonfirst downloader. That means it will automatically put the data in the place the service will expect to load it from.

Privacy Concerns

The service supports the DNT[https://en.wikipedia.org/wiki/Do_Not_Track] header by looking for one of the following headers:

  • DNT
  • dnt
  • do_not_track

When any of these headers are supplied in the request (with any value), the request log will output /[removed]/[removed] instead of the longitude/latitude values.

Configuration

The only available configuration option is the port on which the service runs. To run on a different port, start with:

PORT=3103 npm start

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 89.8%
  • Shell 10.2%