New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pelias-document-service

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pelias-document-service

Web service that synthesizes

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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 Document Service

Travis CI Status Gitter Chat

Overview

Module that provides a web service to aid language-agnostic importers in creating documents for insertion into an Elasticsearch index queryable by the Pelias API. Who's on First data is required in order to populate the documents' administrative hierarchy.

Installation

$ git clone git@github.com:pelias/document-service.git
$ cd document-service
$ npm install
$ npm start /path/to/whos/on/first/data

For ease of use, Who's on First data can be downloaded using scripts provided by the Pelias Who's on First module.

NPM

NPM Module

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

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

Usage

To start the document service, type: npm start <path to Who's on First data>. By default, the service starts on port 5000 but can be overridden in the PORT environmental variable.

Requests are made to the endpoint using the GET method in the format: http://localhost:5000/synthesize/<source>/<layer>.

source is the name of the source of the data that can be used to filter. For example, data imported from OpenAddresses would use openaddresses for source.

Currently, the only valid values for layer are address, street, and venue.

For example: http://localhost:5000/synthesize/openaddresses/address?id=6364a510f0268d6f&lon=-73.9904095&lat=40.74427&name=30+W+26th+St&house_number=30&street=W+26th+St&postcode=10010

Parameters

The following parameters are supported for the service:

namerequireddescription
idyesa unique identifier for reference in Elasticsearch
lonyeslongitude of the record
latyeslatitude of the record
nameyesa textual of the record such as a business name (for venues) or house number + street (for addresses, typically)
house_numberyes with address layer, no otherwisehouse number of an address or venue
streetyes with address or street layer, no otherwisestreet of an address or venue
postcodenopostcode of an address or venue

Error Conditions

A status 400 is returned with an error message under any of the following conditions:

  • lat value is not parseable as a finite number
  • lon value is not parseable as a finite number
  • id value is empty
  • name value is empty
  • layer=address-specific:
    • house_number value is empty
    • street value is empty
  • layer=street-specific:
    • house_number value is non-empty
  • layer=venue-specific:
    • house_number value is non-empty and street value is empty

Keywords

FAQs

Package last updated on 09 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc