WXP::CityTool Class Reference

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

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

List of all members.

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 (int wmo, char *id)
static int toWmo (const char *id, int &wmo)

Detailed Description

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

Author:
Dan Vietor

Member Function Documentation

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

Checks a string list to see if any IDs match current city data

Parameters:
ids String list of station identifiers
data Station data information to compare against
Returns:
1=station data matches ID in list, 0=no match

References WXP::CityData::getId(), WXP::Strings::getLength(), WXP::CityData::getName(), WXP::Strings::getNum(), WXP::CityData::getWmo(), and WXP::Strings::iequal().

Referenced by WXP::CityPlot::draw().

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

Generates the database filename, tacking on file_path location

Parameters:
file Filename to use
Return values:
filename String class to put output filename

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

Referenced by search().

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

Searches database for ID and returns location

Parameters:
file Database filename to use
id Station identifier to search for
Return values:
ept EarthPoint class with station latitude and longitude
Returns:
1=station found, 0=not found

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

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

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

Searches database for ID and returns data

Parameters:
file Database filename to use
id Station identifier to search for
Return values:
data CityData 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::Wxp::outMessage(), and WXP::FileAttr::READ.

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


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

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1