6.0.0 • Published 2 months ago

pelias-whosonfirst v6.0.0

Weekly downloads
154
License
MIT
Repository
github
Last release
2 months ago

Pelias Who's on First Data Importer

Overview

pelias-whosonfirst is a tool used for importing data from the Who's On First project from local files into a Pelias ElasticSearch store.

Requirements

Node.js is required.

See Pelias software requirements for required and recommended versions.

Quickstart Usage

It's strongly recommended that you set at least the countryCode parameter in pelias.json before importing, to reduce the amount of data downloaded.

To install the required Node.js module dependencies, download data for the entire planet (25GB+) and execute the importer, run:

npm install
npm run download
npm start

Configuration

This importer is configured using the pelias-config module. The following configuration options are supported by this importer.

imports.whosonfirst.countryCode

  • Required: no (but recommended)
  • Default:

Use countryCode to configure which country-specific download files to use, saving significant disk space and bandwidth. Can be set to either a single two digit ISO 3166-1 country code, or an array of multiple country codes.

For all valid download options, see the Geocode Earth Who's on First data downloads.

imports.whosonfirst.datapath

  • Required: yes
  • Default:

Full path to where Who's on First data is located (note: the included downloader script will automatically place the WOF data here, and is the recommended way to obtain WOF data)

imports.whosonfirst.importPlace

  • Required: no
  • Default:

Set to a WOF ID or array of IDs to import data only for descendants of those records, rather than the entire planet.

You can use the Who's on First Spelunker or the source_id field from any WOF result of a Pelias query to determine these values.

imports.whosonfirst.importPostalcodes

  • Required: no
  • Default: true

Set to true to enable importing postalcode records. There are over 3 million postal code records.

imports.whosonfirst.maxDownloads

  • Required: no
  • Default: 4

The maximum number of files to download simultaneously. Higher values can be faster, but can also cause donwload errors.

imports.whosonfirst.dataHost

  • Required: no
  • Default: https://data.geocode.earth/wof/dist

The location to download Who's on First data from. Changing this can be useful to use custom data, pin data to a specific date, etc.

Downloading the Data

The download script will download the required SQLite databases into the datapath configured in imports.whosonfirst.datapath.

To install the required node module dependencies and run the download script:

npm install
npm run download

## or

npm run download -- --admin-only # to only download hierarchy data, without postalcodes

Placetypes

This importer supports most of the major placetypes in the Who's on First project

Primarily it supports hierarchy data to represent things like cities, countries, counties, boroughs, etc.

Additionally this importer can bring in postal code data.

Currently, the supported hierarchy types are:

  • borough
  • continent
  • country
  • county
  • dependency
  • disputed
  • empire
  • localadmin
  • locality
  • macrocounty
  • macrohood
  • macroregion
  • marinearea
  • neighbourhood
  • ocean
  • region

Other types may be included in the future.

In Other Projects

This project exposes a collection of Node.js functionality for dealing with Who's on First data and metadata files:

  • isActiveRecord: rejects records that are superseded, deprecated, or otherwise inactive
  • isNotNullIslandRelated: rejects Null Island and other records that intersect it (currently just postal codes at 0/0)
  • recordHasIdAndProperties: rejects Who's on First records missing id or properties
  • recordHasName: rejects records without names
  • conformsTo: filter Who's on First records on a predicate (see lodash's conformsTo for more information)
  • SQLiteStream: provides a Node.js Stream of Who's on First records from a SQLite database
  • toJSONStream: a Node.js stream to convert SQLite records to JSON
6.0.0

2 months ago

5.8.1

4 months ago

5.8.0

5 months ago

5.6.0

10 months ago

5.7.1

9 months ago

5.7.0

9 months ago

5.5.1

2 years ago

5.5.0

3 years ago

5.4.0

3 years ago

5.3.0

3 years ago

5.2.0

3 years ago

5.1.0

4 years ago

5.0.3

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.46.1

4 years ago

2.46.0

4 years ago

2.45.0

4 years ago

2.44.2

5 years ago

2.44.1

5 years ago

2.44.0

5 years ago

2.43.2

5 years ago

2.43.1

5 years ago

2.43.0

5 years ago

2.42.0

5 years ago

2.41.1

5 years ago

2.41.0

5 years ago

2.40.3

5 years ago

2.40.2

5 years ago

2.40.1

5 years ago

2.40.0

5 years ago

2.39.0

5 years ago

2.38.2

5 years ago

2.38.1

5 years ago

2.38.0

5 years ago

2.37.0

5 years ago

2.36.0

5 years ago

2.35.0

5 years ago

2.34.0

5 years ago

2.33.0

5 years ago

2.32.0

5 years ago

2.31.0

5 years ago

2.30.3

5 years ago

2.30.2

5 years ago

2.30.1

5 years ago

2.30.0

5 years ago

2.29.0

5 years ago

2.28.0

5 years ago

2.27.0

5 years ago

2.26.0

6 years ago

2.25.0

6 years ago

2.24.0

6 years ago

2.23.0

6 years ago

2.22.4

6 years ago

2.22.3

6 years ago

2.22.2

6 years ago

2.22.1

6 years ago

2.22.0

6 years ago

2.21.4

6 years ago

2.21.3

6 years ago

2.21.2

6 years ago

2.21.1

7 years ago

2.21.0

7 years ago

2.20.5

7 years ago

2.20.4

7 years ago

2.20.3

7 years ago

2.20.2

7 years ago

2.20.1

7 years ago

2.20.0

7 years ago

2.19.10

7 years ago

2.19.9

7 years ago

2.19.8

7 years ago

2.19.7

7 years ago

2.19.6

7 years ago

2.19.5

7 years ago

2.19.4

7 years ago

2.19.3

7 years ago

2.19.2

7 years ago

2.19.1

7 years ago

2.19.0

7 years ago

2.18.4

7 years ago

2.18.3

7 years ago

2.18.2

7 years ago

2.18.1

7 years ago

2.18.0

7 years ago

2.17.0

7 years ago

2.16.4

7 years ago

2.16.3

7 years ago

2.16.2

7 years ago

2.16.1

7 years ago

2.16.0

7 years ago

2.15.0

7 years ago

2.14.0

7 years ago

2.13.0

7 years ago

2.12.0

7 years ago

2.11.0

7 years ago

2.10.0

7 years ago

2.9.1

7 years ago

2.9.0

7 years ago

2.8.0

7 years ago

2.7.0

7 years ago

2.6.0

8 years ago

2.5.2

8 years ago

2.5.1

8 years ago

2.5.0

8 years ago

2.4.0

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.0

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago