Geoname

public struct Geoname
extension Geoname: Equatable, Hashable

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.

  • The geonameid straight from the geoname table.

    Declaration

    Swift

    public var geonameId: Int64
  • This is pretty much the place’s canonical name. Usually there will be a row in the alternates table with the same name, but not always. When there is such a row, it doesn’t always have is_preferred_name set, and in fact fact there may be another row with a different name with is_preferred_name set.

    Declaration

    Swift

    public var name: String
  • Latitude in decimal degrees.

    Declaration

    Swift

    public var latitude: Double
  • Longitude in decimal degrees.

    Declaration

    Swift

    public var longitude: Double
  • ISO-3166 two-letter uppercase country code, e.g., “US”.

    Declaration

    Swift

    public var countryCode: String
  • The top-level administrative region for the place within its country, like a state or province. For the U.S., the two-letter uppercase state abbreviation.

    Declaration

    Swift

    public var admin1Code: String
  • Population size.

    Declaration

    Swift

    public var population: UInt64
  • Declaration

    Swift

    public init(
        /**
         * The `geonameid` straight from the geoname table.
         */geonameId: Int64, 
        /**
         * This is pretty much the place's canonical name. Usually there will be a
         * row in the alternates table with the same name, but not always. When
         * there is such a row, it doesn't always have `is_preferred_name` set, and
         * in fact fact there may be another row with a different name with
         * `is_preferred_name` set.
         */name: String, 
        /**
         * Latitude in decimal degrees.
         */latitude: Double, 
        /**
         * Longitude in decimal degrees.
         */longitude: Double, 
        /**
         * ISO-3166 two-letter uppercase country code, e.g., "US".
         */countryCode: String, 
        /**
         * The top-level administrative region for the place within its country,
         * like a state or province. For the U.S., the two-letter uppercase state
         * abbreviation.
         */admin1Code: String, 
        /**
         * Population size.
         */population: UInt64)
  • Declaration

    Swift

    public static func == (lhs: Geoname, rhs: Geoname) -> Bool
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)