NCBI C++ ToolKit
|
Search Toolkit Book for CLatLonMap_Base
#include <objects/seqfeat/SubSource.hpp>
Public Types | |
enum | ELatLonAdjustFlags { fNone = 0 , fFlip = 1 , fNegateLat = (1 << 1) , fNegateLon = (1 << 2) } |
typedef int | TLatLonAdjustFlags |
Bitwise OR of "ELatLonAdjustFlags". More... | |
Public Member Functions | |
CLatLonMap_Base (bool is_water) | |
~CLatLonMap_Base (void) | |
bool | IsCountryInLatLon (const string &country, double lat, double lon) const |
const CCountryExtreme * | GuessRegionForLatLon (double lat, double lon, const string &country=kEmptyStr, const string &province=kEmptyStr) const |
const CCountryExtreme * | FindClosestToLatLon (double lat, double lon, double range, double &distance) |
bool | IsClosestToLatLon (const string &country, double lat, double lon, double range, double &distance) const |
bool | HaveLatLonForRegion (const string &country) const |
bool | DoCountryBoxesOverlap (const string &country1, const string &country2) const |
const CCountryExtreme * | IsNearLatLon (double lat, double lon, double range, double &distance, const string &country, const string &province=kEmptyStr) const |
double | GetScale (void) const |
int | AdjustAndRoundDistance (double distance) const |
Static Public Member Functions | |
static int | AdjustAndRoundDistance (double distance, double scale) |
Private Types | |
typedef vector< CCountryLine * > | TCountryLineList |
typedef TCountryLineList::const_iterator | TCountryLineList_iter |
typedef vector< CCountryExtreme * > | TCountryExtremeList |
typedef TCountryExtremeList::const_iterator | TCountryExtremeList_iter |
Private Member Functions | |
void | x_InitFromDefaultList (const char *const *list, int num) |
bool | x_InitFromFile (const string &filename) |
size_t | x_GetLatStartIndex (int y) const |
const CCountryExtreme * | x_FindCountryExtreme (const string &country) const |
Static Private Member Functions | |
static bool | s_CompareTwoLinesByLatLonOnly (const CCountryLine *line1, const CCountryLine *line2) |
static bool | s_CompareTwoLinesByCountry (const CCountryLine *line1, const CCountryLine *line2) |
static bool | s_CompareTwoLinesByLatLonThenCountry (const CCountryLine *line1, const CCountryLine *line2) |
Private Attributes | |
TCountryLineList | m_CountryLineList |
TCountryLineList | m_LatLonSortedList |
double | m_Scale |
TCountryExtremeList | m_CountryExtremes |
Definition at line 473 of file SubSource.hpp.
|
private |
Definition at line 525 of file SubSource.hpp.
|
private |
Definition at line 526 of file SubSource.hpp.
|
private |
Definition at line 518 of file SubSource.hpp.
|
private |
Definition at line 519 of file SubSource.hpp.
Bitwise OR of "ELatLonAdjustFlags".
Definition at line 502 of file SubSource.hpp.
Enumerator | |
---|---|
fNone | |
fFlip | |
fNegateLat | |
fNegateLon |
Definition at line 496 of file SubSource.hpp.
CLatLonMap_Base::CLatLonMap_Base | ( | bool | is_water | ) |
Definition at line 5752 of file SubSource.cpp.
References BEGIN_COMMA_END, copy(), NStr::EndsWith(), NStr::Equal(), i, ITERATE, k_NumLatLonCountryText, k_NumLatLonWaterText, m_CountryExtremes, m_CountryLineList, m_LatLonSortedList, NON_CONST_ITERATE, s_CompareTwoLinesByLatLonOnly(), s_CompareTwoLinesByLatLonThenCountry(), ct::sort(), string, x_InitFromDefaultList(), and x_InitFromFile().
CLatLonMap_Base::~CLatLonMap_Base | ( | void | ) |
Definition at line 5832 of file SubSource.cpp.
References i, m_CountryExtremes, m_CountryLineList, and m_LatLonSortedList.
int CLatLonMap_Base::AdjustAndRoundDistance | ( | double | distance | ) | const |
Definition at line 6254 of file SubSource.cpp.
References AdjustAndRoundDistance(), and m_Scale.
|
static |
Definition at line 6239 of file SubSource.cpp.
Referenced by AdjustAndRoundDistance().
bool CLatLonMap_Base::DoCountryBoxesOverlap | ( | const string & | country1, |
const string & | country2 | ||
) | const |
Definition at line 6220 of file SubSource.cpp.
References CCountryExtreme::DoesOverlap(), NStr::IsBlank(), and x_FindCountryExtreme().
const CCountryExtreme * CLatLonMap_Base::FindClosestToLatLon | ( | double | lat, |
double | lon, | ||
double | range, | ||
double & | distance | ||
) |
Definition at line 6061 of file SubSource.cpp.
References CCountryLine::ConvertLon(), DistanceOnGlobe(), EPSILON, CCountryExtreme::GetArea(), CCountryExtreme::GetLevel1(), int, NStr::IsBlank(), m_LatLonSortedList, m_Scale, NULL, compile_time_bits::range(), and x_GetLatStartIndex().
Referenced by CSubSource::x_CalculateLatLonId().
|
inline |
Definition at line 492 of file SubSource.hpp.
References m_Scale.
const CCountryExtreme * CLatLonMap_Base::GuessRegionForLatLon | ( | double | lat, |
double | lon, | ||
const string & | country = kEmptyStr , |
||
const string & | province = kEmptyStr |
||
) | const |
Definition at line 5967 of file SubSource.cpp.
References CCountryLine::ConvertLon(), CCountryExtreme::GetArea(), m_LatLonSortedList, m_Scale, NULL, CCountryExtreme::PreferTo(), and x_GetLatStartIndex().
Referenced by CSubSource::x_CalculateLatLonId().
Definition at line 5930 of file SubSource.cpp.
References NULL, and x_FindCountryExtreme().
bool CLatLonMap_Base::IsClosestToLatLon | ( | const string & | country, |
double | lat, | ||
double | lon, | ||
double | range, | ||
double & | distance | ||
) | const |
Definition at line 6111 of file SubSource.cpp.
References CCountryLine::ConvertLon(), DistanceOnGlobe(), EPSILON, NStr::Equal(), CCountryExtreme::GetArea(), int, NStr::IsBlank(), m_LatLonSortedList, m_Scale, compile_time_bits::range(), x_FindCountryExtreme(), and x_GetLatStartIndex().
Definition at line 5850 of file SubSource.cpp.
References NStr::Compare(), CCountryLine::ConvertLat(), CCountryLine::ConvertLon(), NStr::EqualNocase(), m_CountryLineList, and m_Scale.
const CCountryExtreme * CLatLonMap_Base::IsNearLatLon | ( | double | lat, |
double | lon, | ||
double | range, | ||
double & | distance, | ||
const string & | country, | ||
const string & | province = kEmptyStr |
||
) | const |
Definition at line 6171 of file SubSource.cpp.
References CCountryLine::ConvertLat(), CCountryLine::ConvertLon(), DistanceOnGlobe(), EPSILON, NStr::EqualNocase(), int, NStr::IsBlank(), m_LatLonSortedList, m_Scale, NULL, compile_time_bits::range(), and x_GetLatStartIndex().
Referenced by CSubSource::x_CalculateLatLonId().
|
staticprivate |
Definition at line 5710 of file SubSource.cpp.
References NStr::CompareNocase(), line1, line2, and s_CompareTwoLinesByLatLonOnly().
|
staticprivate |
Definition at line 5693 of file SubSource.cpp.
Referenced by CLatLonMap_Base(), and s_CompareTwoLinesByCountry().
|
staticprivate |
Definition at line 5725 of file SubSource.cpp.
References NStr::CompareNocase(), line1, and line2.
Referenced by CLatLonMap_Base().
|
private |
Definition at line 5905 of file SubSource.cpp.
References NStr::CompareNocase(), NStr::EqualNocase(), NStr::IsBlank(), m_CountryExtremes, and NULL.
Referenced by DoCountryBoxesOverlap(), HaveLatLonForRegion(), and IsClosestToLatLon().
|
private |
Definition at line 5940 of file SubSource.cpp.
References m_LatLonSortedList.
Referenced by FindClosestToLatLon(), GuessRegionForLatLon(), IsClosestToLatLon(), and IsNearLatLon().
Definition at line 5586 of file SubSource.cpp.
References ERR_POST, i, isalpha(), isdigit(), m_CountryLineList, m_Scale, Note, NStr::Split(), and NStr::StringToDouble().
Referenced by CLatLonMap_Base().
Definition at line 5620 of file SubSource.cpp.
References CTempString::data(), ERR_POST, CTempString::find(), g_FindDataFile(), isalpha(), NStr::IsBlank(), isdigit(), CTempString::length(), lr(), m_CountryLineList, m_Scale, ILineReader::New(), Note, NPOS, and NStr::StringToDouble().
Referenced by CLatLonMap_Base().
|
private |
Definition at line 527 of file SubSource.hpp.
Referenced by CLatLonMap_Base(), x_FindCountryExtreme(), and ~CLatLonMap_Base().
|
private |
Definition at line 521 of file SubSource.hpp.
Referenced by CLatLonMap_Base(), IsCountryInLatLon(), x_InitFromDefaultList(), x_InitFromFile(), and ~CLatLonMap_Base().
|
private |
Definition at line 522 of file SubSource.hpp.
Referenced by CLatLonMap_Base(), FindClosestToLatLon(), GuessRegionForLatLon(), IsClosestToLatLon(), IsNearLatLon(), x_GetLatStartIndex(), and ~CLatLonMap_Base().
|
private |
Definition at line 523 of file SubSource.hpp.
Referenced by AdjustAndRoundDistance(), FindClosestToLatLon(), GetScale(), GuessRegionForLatLon(), IsClosestToLatLon(), IsCountryInLatLon(), IsNearLatLon(), x_InitFromDefaultList(), and x_InitFromFile().