GetGeoLocatorSearchResult (GET)

The action route is responsible for handling the location search query based on the search key the user submitted and the language used.

Parameters

Name Type Description Required?
`term` String User input search term **true** (unless `lon` and `lat` present)
`country` String ELF country (autocomplete list) **optional**
`region` String ELF AU name **optional**
`epsg` String Target coordinate reference system e.g. epsg:3035 **true**
`fuzzy` Boolean Fuzzy search mode **optional** (defaults to false)
`exonym` Boolean exonym names (names in other languages) included **optional** (defaults to false)
`lon` String Longitude - reverse geocoding, if this in parameters **optional**
`lat` String Longitude - reverse geocoding, if this in parameters **optional**
`language` String The language where the search will be targeted to **true**

Response

Success

{
  "totalCount": "<Total count from all result items>",
  "locations": [ // Array from search result items
    {
      "id": "<result identifier>",
      "rank": "<semantic ordering number>",
      "lon": "<longitude>",
      "village": "<ELF parent title>",
      "name": "<name>",
      "zoomLevel": "<zoom level>",
      "type": "<ELF locationType title>",
      "lat": "<latitude>"
    }
  ]
}

Error

Returns HTTP code 500 with an error message as a string in response body. Will return an error if the term param is empty, if it contains the * character and is under 4 characters long or if it contains more than one * characters. (not in reverse geocoding)

Examples

Example geocoding query for Paikkatietoikkuna

http://www.paikkatietoikkuna.fi/web/fi/kartta?p_p_id=Portti2Map_WAR_portti2mapportlet&p_p_lifecycle=2&action_route=GetGeoLocatorSearchResult&lang=en&&epsg=EPSG:3067&term=Helsinki&region=&fuzzy=true&exonym=true

Example geocoding query for oskari-map servlet (normal search with country filter)

http://localhost:8888/oskari-map/?action_route=GetGeoLocatorSearchResult&lang=en&epsg=EPSG:3857&term=Helsinki&region=&country=FI&normal=true&filter=false&fuzzy=false&exonym=false Response:

{"totalCount":18,"locations":
[{"id":0,"rank":0,"lon":"388404.3740437103","village":"Helsinki (fin)","name":"Els&iacute;nki","type":"variant","lat":"6671584.128010677"},
{"id":1,"rank":0,"lon":"388404.3740437103","village":"Helsinki (fin)","name":"Helsingfors","type":"variant","lat":"6671584.128010677"},...}

Example reverse geocoding query for Paikkatietoikkuna

`http://www.paikkatietoikkuna.fi/web/fi/kartta?p_p_id=Portti2Map_WAR_portti2mapportlet&p_p_lifecycle=2&action_route=GetGeoLocatorSearchResult&lang=en&lat=60.4848175&lon=22.4390926&epsg=EPSG:3067&exonym=false'

Last modified: Fri Mar 15 2024 14:11:33 GMT+0200 (Eastern European Standard Time)