WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
WXP::CityTool Class Reference

This class is a set of tools for working with city databases. More...

#include "../include/CityTool.h"

Static Public Member Functions

static int getFilename (const char *file, String &filename)
 
static int search (const char *file, const char *id, CityData &data)
 
static int locate (const char *file, const char *id, EarthPoint &ept)
 
static int compareData (Strings &ids, CityData &data)
 
static int toId (const char *wmo, char *id)
 
static int toWmo (const char *id, char *wmo)
 

Detailed Description

This class is a set of tools for working with city databases.

Author
Dan Vietor

Member Function Documentation

◆ compareData()

int CityTool::compareData ( Strings ids,
CityData data 
)
static

◆ getFilename()

int CityTool::getFilename ( const char *  file,
String filename 
)
static

Generates the database filename, tacking on file_path location

Parameters
fileFilename to use
Return values
filenameString class to put output filename

References WXP::FileTool::addPath(), WXP::Wxp::getDatabasePath(), and WXP::StrLib::iequal().

Referenced by search().

◆ locate()

int CityTool::locate ( const char *  file,
const char *  id,
EarthPoint ept 
)
static

Searches database for ID and returns location

Parameters
fileDatabase filename to use
idStation identifier to search for
Return values
eptEarthPoint class with station latitude and longitude
Returns
1=station found, 0=not found

References WXP::EarthPoint::elev, WXP::CityData::getElev(), WXP::CityData::getLat(), WXP::CityData::getLon(), WXP::EarthPoint::init(), WXP::EarthPoint::lat, WXP::EarthPoint::lon, and search().

Referenced by WXP::HodoPlot::draw(), and WXP::SoundPlot::draw().

◆ search()

int CityTool::search ( const char *  file,
const char *  id,
CityData data 
)
static

Searches database for ID and returns data

Parameters
fileDatabase filename to use
idStation identifier to search for
Return values
dataCityData class with station information
Returns
1=station found, 0=not found

References WXP::String::get(), getFilename(), WXP::CityData::getId(), WXP::CityData::getName(), WXP::CityData::getWmo(), WXP::StrLib::iequal(), WXP::CityFile::isOpen(), WXP::Wxp::outMessage(), WXP::CityFile::read(), WXP::FileAttr::READ, and WXP::CityFile::rewind().

Referenced by WXP::HodoPlot::draw(), WXP::SoundPlot::draw(), WXP::MdrPlot::getDomain(), WXP::NidsPlot::getDomain(), WXP::RcmPlot::getDomain(), and locate().

◆ toId()

int CityTool::toId ( const char *  wmo,
char *  id 
)
static

Encodes a numeric WMO ID into a character station ID

Parameters
wmoWMO number
Return values
idCoded station ID (min 6 characters)

Referenced by WXP::UpaRawinHash::put(), and WXP::UpaRawinHash::setup().

◆ toWmo()

int CityTool::toWmo ( const char *  id,
char *  wmo 
)
static

Converts encoded station ID back to WMO number

Parameters
idCoded station ID
Return values
wmoWMO ID
See also
toId

Referenced by WXP::CityHash::get().


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