Package-level declarations

Types

Link copied to clipboard

Fetches cartographic boundary information using the Nominatim API. This class retrieves boundaries based on provided administrative levels (e.g., city, state, country) and corresponding names. It operates asynchronously and emits successfully retrieved CartographicBoundary objects through a returned Flow of CartographicBoundary.

Link copied to clipboard
open class GeoJSON<T>(val type: String, val coordinates: T)

geoJSON class used to create objects in the Nominatim API JSON result it follows the guidelines of the GeoJSON format

Link copied to clipboard
abstract class GeoJSONAttributes

Class used for JSON deserializer purposes

Link copied to clipboard
open class JSONResult<T>(val boundingBox: List<String>, val geoJSON: GeoJSON<T>, val displayName: String, val type: String)

The class that represents the JSON returned by the API.

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

Link copied to clipboard

Custom deserializer for JSONResult<GeoJSONAttributes> objects handling different GeoJSON types.

Link copied to clipboard

Helper class for creating a Retrofit instance to interact with the Nominatim API. This class uses a singleton pattern to provide a single instance of the Retrofit object.

Functions

Link copied to clipboard

Converts a list of four strings representing a bounding box in the order:

Link copied to clipboard

Converts a JSONResult object containing GeoJSON data into a CartographicBoundary object. A CartographicBoundary represents the geographic boundary of an administrative unit (e.g., country, state, county).

Link copied to clipboard

Converts a list of coordinates (assumed to be longitude first, latitude second) returned by the API to a GeoLocation object.

Link copied to clipboard

Convert a List of a List of coordinates into a list of GeoLocation

Link copied to clipboard

Converts a list of lists of lists of lists of coordinates into a list of lists of lists of GeoLocation objects, representing a multipolygon.

Link copied to clipboard

Converts a list of lists of lists of coordinates into a list of lists of GeoLocation objects, representing a polygon.