getResultsCity

@GET(value = "/search?")
abstract suspend fun getResultsCity(@Query(value = "city") city: String, @Query(value = "state") state: String, @Query(value = "country") country: String, @Query(value = "polygon_geojson") polygonGeoJSON: Int = 1, @Query(value = "limit") limit: Int = 2, @Query(value = "format") format: String = "jsonv2"): List<JSONResult<GeoJSONAttributes>>

Fetches the results for a specific city using the Nominatim API.

Return

A list of JSON results from the Nominatim API (limited to 2). The first result is typically chosen, but if the second has a higher relevancy score (based on certain criteria, e.g., specific property value), it might be used instead.

Parameters

city

The name of the city (typically from the locality property of AdministrativeUnitName).

state

The state name (typically from the adminArea property of AdministrativeUnitName).

country

The country name (typically from the countryName property of AdministrativeUnitName).

polygonGeoJSON

specifies the API to return the geoJSON format

limit

limits the result of 2 to check if the second one is more relevant

format

specifies that will be a json return