NominatimAPI

interface NominatimAPI

The interface for interacting with the Nominatim API to fetch information required for building CartographicBoundary objects. This interface defines methods for retrieving geospatial data based on different administrative unit types.

Functions

Link copied to clipboard
@GET(value = "/search?")
abstract suspend fun getResults(@Query(value = "q") q: String, @Query(value = "polygon_geojson") polygonGeoJSON: Int = 1, @Query(value = "limit") limit: Int = 1, @Query(value = "format") format: String = "jsonv2"): List<JSONResult<GeoJSONAttributes>>

this one is more generic. It's used when the more specific one didn't return a proper Polygon

Link copied to clipboard
@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.

Link copied to clipboard
@GET(value = "/search?")
abstract suspend fun getResultsCountry(@Query(value = "country") country: String, @Query(value = "polygon_geojson") polygonGeoJSON: Int = 1, @Query(value = "limit") limit: Int = 1, @Query(value = "format") format: String = "jsonv2"): List<JSONResult<GeoJSONAttributes>>

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

Link copied to clipboard
@GET(value = "/search?")
abstract suspend fun getResultsCounty(@Query(value = "county") county: String, @Query(value = "state") state: String, @Query(value = "country") country: String, @Query(value = "polygon_geojson") polygonGeoJSON: Int = 1, @Query(value = "limit") limit: Int = 1, @Query(value = "format") format: String = "jsonv2"): List<JSONResult<GeoJSONAttributes>>

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

Link copied to clipboard
@GET(value = "/search?")
abstract suspend fun getResultsState(@Query(value = "state") state: String, @Query(value = "country") country: String, @Query(value = "polygon_geojson") polygonGeoJSON: Int = 1, @Query(value = "limit") limit: Int = 1, @Query(value = "format") format: String = "jsonv2"): List<JSONResult<GeoJSONAttributes>>

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