You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.5 KiB

## /search
10 years ago
Full text search endpoint which queries the elasticsearch doc store, slightly slower than suggest.
10 years ago
#### Required Parameters
* **input**: query string
#### Optional Parameters
* **lat**: latitude
* **lon**: longitude
* **zoom**: zoom level from which you wish to view the world
* **size**: number of results requested (defaults to 10)
* **layers**: datasets you wish to query (defaults to ```poi,admin,address```).
* valid values are ```poi```, ```admin``` or ```address```
* ```poi``` expands internally to ```geoname```, ```osmnode```, ```osmway```
* ```admin``` expands to ```admin0```, ```admin1```, ```admin2```, ```neighborhood```, ```locality```, ```local_admin```
* ```address``` expands to ```osmaddress```, ```openaddresses```
* can also be specific to one particular dataset, for example ```geoname```
* **bbox**: the bounding box from which you want all your results to come
* can be one of the following comma separated string values
* "southwest_lng,southwest_lat,northeast_lng,northeast_lat" ```L.latLngBounds(southwestLatLng, northeastLatLng).toBBoxString()```
* bottom left lon, bottom left lat, top right lon, top right lat
* left, bottom, right, top
10 years ago
* min longitude, min latitude, max longitude, max latitude
* **details**: indicates if results should contain detailed, should be `true` or `false`
* when false results will only contain `id`, `layer`, and `text` properties
* when true, all available properties will be included in results
10 years ago
## /search/coarse
This is a coarse forward geocoder endpoint which only searches admin dataset layers.
10 years ago
#### Required Parameters
* **input**: query string
#### Optional Parameters
* **lat**: latitude
* **lon**: longitude
* **zoom**: zoom level from which you wish to view the world
* **bbox**: the bounding box frome which you want all your results to come
10 years ago
* **size**: (defaults to 10)
* **layers**: (defaults to ```admin```)
10 years ago
* **details**: (defaults to `true`)
10 years ago
## /suggest
10 years ago
The autocomplete endpoint, it offers fast response time. Mixes results from around the provided lat/lon and also from precision level 1 and 3.
#### Required Parameters
* **input**: query string
* **lat**: latitude
* **lon**: longitude
* lat/lon are **required** currently because of this [open issue](https://github.com/elasticsearch/elasticsearch/issues/6444)
#### Optional Parameters
* **zoom**: zoom level from which you wish to view the world
10 years ago
* **size**: number of results requested (defaults to 10)
* **layers**: datasets you wish to query (defaults to ```poi,admin,address```)
10 years ago
* **details**: (defaults to `true`)
## /suggest/coarse
10 years ago
Only queries the admin layers.
#### Required Parameters
* **input**: query string
* **lat**: latitude from where you are searching
* **lon**: longitude
* lat/lon are **required** currently because of this [open issue](https://github.com/elasticsearch/elasticsearch/issues/6444)
#### Optional Parameters
* **zoom**: zoom level from which you wish to view the world
* **size**: number of results requested (defaults to 10)
* **layers**: datasets you wish to query (defaults to ```admin```)
10 years ago
* **details**: (defaults to `true`)
## /suggest/nearby
10 years ago
Works as autocomplete for places located near a latitude/longitude, this endpoint is the same as ```/suggest``` but the results are all from within 50 kilometers of the specified point. Unlike ```/suggest```, ```/suggest/nearby``` does not mix results from different precision levels (500km, 1000km etc from lat/lon).
10 years ago
#### Required Parameters
* **input**: query string
* **lat**: latitude
* **lon**: longitude
* lat/lon are **required** currently because of this [open issue](https://github.com/elasticsearch/elasticsearch/issues/6444)
#### Optional Parameters
* **zoom**: zoom level from which you wish to view the world
10 years ago
* **size**: number of results you need (defaults to 10)
* **layers**: datasets you wish to query (defaults to ```poi,admin,address```)
10 years ago
* **details**: (defaults to `true`)
## /reverse
10 years ago
Reverse geocoding endpoint.
#### Required Parameters
* **lat**: latitude
* **lon**: longitude
#### Optional Parameters
* **zoom**: zoom level from which you wish to view the world
10 years ago
* **bbox**: bounding box
10 years ago
* **layers**: (defaults to ```poi,admin,address```)
10 years ago
* **details**: (defaults to `true`)
## /doc
10 years ago
Retrieves a document or multiple documents at once.
10 years ago
#### Required Parameters
* one of **id** or **ids**
* **id**:
10 years ago
* unique id of the document to be retrieved
10 years ago
* should be in the form of type:id, for example: ```geoname:4163334```
10 years ago
* **ids**:
10 years ago
* if multiple docs are to be fetched in bulk, an array of ids