City Generator 1.0.1
Procedural city generation for C++23
Loading...
Searching...
No Matches
dasmig::city Class Reference

Return type for city generation, holding all GeoNames fields. More...

#include <citygen.hpp>

Public Member Functions

std::uint64_t seed () const
 Retrieve the random seed used to generate this city.
 
 operator std::string () const
 Implicit conversion to std::string.
 

Public Attributes

std::uint32_t geonameid {0}
 GeoNames primary key.
 
std::string name
 UTF-8 city name.
 
std::string asciiname
 Plain ASCII transliteration of the name.
 
double latitude {0.0}
 WGS84 latitude in decimal degrees.
 
double longitude {0.0}
 WGS84 longitude in decimal degrees.
 
std::string feature_code
 GeoNames feature code (PPL, PPLA, PPLC, etc.).
 
std::string country_code
 ISO-3166 two-letter country code.
 
std::string cc2
 Alternate country codes (comma-separated).
 
std::string admin1_code
 First-level administrative division code (state/province).
 
std::string admin2_code
 Second-level administrative division code (county/district).
 
std::string admin3_code
 Third-level administrative division code (township/commune).
 
std::string admin4_code
 Fourth-level administrative division code (sub-district).
 
std::uint64_t population {0}
 City population.
 
std::int16_t elevation {-9999}
 Elevation in meters (-9999 if unknown).
 
std::int16_t dem {0}
 Digital elevation model value (more reliable than elevation).
 
std::string timezone
 IANA timezone identifier (e.g., "Europe/London").
 

Friends

class cg
 Allows cg to set the seed.
 
std::ostream & operator<< (std::ostream &os, const city &c)
 Stream the city name to an output stream.
 

Detailed Description

Return type for city generation, holding all GeoNames fields.

Supports implicit conversion to std::string (returns the city name) and streaming via operator<<.

Definition at line 42 of file citygen.hpp.

Member Function Documentation

◆ operator std::string()

dasmig::city::operator std::string ( ) const
inline

Implicit conversion to std::string.

Returns
The UTF-8 city name.

Definition at line 103 of file citygen.hpp.

◆ seed()

std::uint64_t dasmig::city::seed ( ) const
inline

Retrieve the random seed used to generate this city.

Returns
The per-call seed for replay.
See also
cg::get_city(std::uint64_t)

Definition at line 96 of file citygen.hpp.

Friends And Related Symbol Documentation

◆ cg

friend class cg
friend

Allows cg to set the seed.

Definition at line 121 of file citygen.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const city c 
)
friend

Stream the city name to an output stream.

Parameters
osOutput stream.
cCity to stream.
Returns
Reference to the output stream.

Definition at line 112 of file citygen.hpp.

Member Data Documentation

◆ admin1_code

std::string dasmig::city::admin1_code

First-level administrative division code (state/province).

Definition at line 70 of file citygen.hpp.

◆ admin2_code

std::string dasmig::city::admin2_code

Second-level administrative division code (county/district).

Definition at line 73 of file citygen.hpp.

◆ admin3_code

std::string dasmig::city::admin3_code

Third-level administrative division code (township/commune).

Definition at line 76 of file citygen.hpp.

◆ admin4_code

std::string dasmig::city::admin4_code

Fourth-level administrative division code (sub-district).

Definition at line 79 of file citygen.hpp.

◆ asciiname

std::string dasmig::city::asciiname

Plain ASCII transliteration of the name.

Definition at line 52 of file citygen.hpp.

◆ cc2

std::string dasmig::city::cc2

Alternate country codes (comma-separated).

Definition at line 67 of file citygen.hpp.

◆ country_code

std::string dasmig::city::country_code

ISO-3166 two-letter country code.

Definition at line 64 of file citygen.hpp.

◆ dem

std::int16_t dasmig::city::dem {0}

Digital elevation model value (more reliable than elevation).

Definition at line 88 of file citygen.hpp.

◆ elevation

std::int16_t dasmig::city::elevation {-9999}

Elevation in meters (-9999 if unknown).

Definition at line 85 of file citygen.hpp.

◆ feature_code

std::string dasmig::city::feature_code

GeoNames feature code (PPL, PPLA, PPLC, etc.).

Definition at line 61 of file citygen.hpp.

◆ geonameid

std::uint32_t dasmig::city::geonameid {0}

GeoNames primary key.

Definition at line 46 of file citygen.hpp.

◆ latitude

double dasmig::city::latitude {0.0}

WGS84 latitude in decimal degrees.

Definition at line 55 of file citygen.hpp.

◆ longitude

double dasmig::city::longitude {0.0}

WGS84 longitude in decimal degrees.

Definition at line 58 of file citygen.hpp.

◆ name

std::string dasmig::city::name

UTF-8 city name.

Definition at line 49 of file citygen.hpp.

◆ population

std::uint64_t dasmig::city::population {0}

City population.

Definition at line 82 of file citygen.hpp.

◆ timezone

std::string dasmig::city::timezone

IANA timezone identifier (e.g., "Europe/London").

Definition at line 91 of file citygen.hpp.


The documentation for this class was generated from the following file: