GnafApi

GnafApi

new GnafApi(corsProxy, overrideUrlopt)

Source:

Simple JS Api for the Data61 Lucene GNAF service.

Parameters:
Name Type Attributes Description
corsProxy CorsProxy

CorsProxy to use to determine whether calls need to go through the terria proxy.

overrideUrl String <optional>

The URL to use to query the service - will default if not provided.

Methods

bulkGeoCode(searchTermList, rectangleopt, batchSizeopt, maxSimultaneousRequestsopt) → {Promise}

Source:

Bulk geocodes in batches with a list of plain-text address. Returns results along with their scores.

If a bounding box is provided, this is used and no results will be returned from outside the bounding box.

Parameters:
Name Type Attributes Default Description
searchTermList Array

A list of strings representing the addresses to geocode

rectangle Rectangle <optional>

An optional rectangle describing a box to search within. If this is not provided then everywhere is searched.

batchSize number <optional>
DEFAULT_BATCH_SIZE

Maximum number of addresses in each request.

maxSimultaneousRequests number <optional>
DEFAULT_MAX_SIMULTANEOUS_REQUESTS

Maximum number of requests submitted at one time.

Returns:

Promise that resolves when the search is done.

Type
Promise

geoCode(searchTerm, rectangleopt, maxResultsopt) → {Promise}

Source:

Geocodes a plain-text address. Returns results along with their scores.

If a bounding box is provided, this is queried, and all results that are returned must lie within the bounding box.

Parameters:
Name Type Attributes Description
searchTerm string

The address to geocode

rectangle Rectangle <optional>

An optional rectangle describing a box to search within. If this is not provided then everywhere is searched.

maxResults number <optional>

The maximum number of results to return - defaults to 10.

Returns:

Promise that resolves when the search is done.

Type
Promise