openaddresses-plugin

The openaddresses-plugin plugin can be used to generate real addresses from the OpenAddresses project. The plugin uses geojson files from the project to generate addresses.

Usage

Before using the plugin, you need to initialize the plugin in the plugin options. The plugin takes the following options:

Initialize the memory backend

json { "options": { "plugins": { "openaddresses-plugin": { "path": "/path/to/openaddresses_plugin", "args": { "files": ["/path/to/geojson/file1", "/path/to/geojson/file2"], "backend": { "type": "memory" } } } } } }

Initialize the sqlite backend

This will initialize the sqlite backend and create a sqlite database at /path/to/sqlite/database.db. The database will be populated with the data from the geojson files, which may take some time. If the database already exists, it will be used instead of creating a new one.

json { "options": { "plugins": { "openaddresses-plugin": { "path": "/path/to/openaddresses_plugin", "args": { "files": ["/path/to/geojson/file1", "/path/to/geojson/file2"], "backend": { "type": "sqlite", "databaseName": "/path/to/sqlite/database.db" } } } } } }

Generate addresses

In order to use the plugin, provide the openaddresses-plugin plugin name in the plugin generator.

The plugin accepts an object containing the names of the properties to generate as keys and the fields to use as values. The following field types are supported:

The objects may also be nested, to create nested objects.

Example

json { "type": "plugin", "pluginName": "openaddresses-plugin", "args": { "street": "street", "houseNumber": "number", "city": "city", "coordinates": { "latitude": "latitude", "longitude": "longitude" } } }

This will produce an object like this:

json { "street": "Muncaster Rd", "houseNumber": "831", "city": "HAINES", "coordinates": { "latitude": 59.2442386, "longitude": -135.4394579 } }