Geoname

data class Geoname(var geonameId: Long, var geonameType: GeonameType, var name: String, var countryCode: String, var featureClass: String, var featureCode: String, var adminDivisionCodes: Map<UByte, String>, var population: ULong, var latitude: String, var longitude: String)

A single geographic place.

This corresponds to a single row in the main "geoname" table described in the GeoNames documentation 1. We exclude fields we don't need.

Constructors

Link copied to clipboard
constructor(geonameId: Long, geonameType: GeonameType, name: String, countryCode: String, featureClass: String, featureCode: String, adminDivisionCodes: Map<UByte, String>, population: ULong, latitude: String, longitude: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Administrative divisions. This maps admin division levels (1-based) to their corresponding codes. For example, Liverpool has two admin divisions: "ENG" at level 1 and "H8" at level 2. They would be represented in this map with entries (1, "ENG") and (2, "H8").

Link copied to clipboard

ISO-3166 two-letter uppercase country code, e.g., "US".

Link copied to clipboard

Primary geoname category. Examples:

Link copied to clipboard

Secondary geoname category, depends on feature_class. Examples:

Link copied to clipboard

The geonameid straight from the geoname table.

Link copied to clipboard

The geoname type. This is derived from feature_class and feature_code as a more convenient representation of the type.

Link copied to clipboard

Latitude in decimal degrees (as a string).

Link copied to clipboard

Longitude in decimal degrees (as a string).

Link copied to clipboard

The place's primary name.

Link copied to clipboard

Population size.