libosmscout
0.1
|
#include <LocationIndex.h>
Classes | |
class | ScopeCacheCleaner |
Util class that cleanup location index cache when instance is destructed. More... | |
Public Member Functions | |
void | DumpStatistics () const |
void | FlushCache () const |
uint32_t | GetAddressMaxWords () const |
const std::vector< std::string > & | GetLocationIgnoreTokens () const |
uint32_t | GetLocationMaxWords () const |
const std::vector< std::string > & | GetPOIIgnoreTokens () const |
uint32_t | GetPOIMaxWords () const |
const std::vector< std::string > & | GetRegionIgnoreTokens () const |
uint32_t | GetRegionMaxWords () const |
bool | IsLocationIgnoreToken (const std::string &token) const |
bool | IsRegionIgnoreToken (const std::string &token) const |
bool | Load (const std::string &path, bool memoryMappedData) |
LocationIndex ()=default | |
bool | ResolveAdminRegionHierachie (const AdminRegionRef ®ion, std::map< FileOffset, AdminRegionRef > &refs) const |
bool | VisitAddresses (const AdminRegion ®ion, const PostalArea &postalArea, const Location &location, AddressVisitor &visitor) const |
Visit all addresses for a given location (in a given AdminRegion) More... | |
bool | VisitAdminRegions (AdminRegionVisitor &visitor) const |
Visit all admin regions. More... | |
bool | VisitAdminRegions (const AdminRegion &adminRegion, AdminRegionVisitor &visitor) const |
Visit given admin region and all sub regions. More... | |
bool | VisitLocations (const AdminRegion &adminRegion, const PostalArea &postalArea, LocationVisitor &visitor, bool recursive=true) const |
Visit all locations within the given admin region and postal region. More... | |
bool | VisitLocations (const AdminRegion &adminRegion, LocationVisitor &visitor, bool recursive=true) const |
Visit all locations within the given admin region and its children. More... | |
bool | VisitPOIs (const AdminRegion ®ion, POIVisitor &visitor, bool recursive=true) const |
Visit all POIs within the given admin region. More... | |
virtual | ~LocationIndex ()=default |
Static Public Attributes | |
static const char *const | FILENAME_LOCATION_IDX = "location.idx" |
Location index returns objects by names (the name should be changed). You can currently either search for regions like 'cities' or for named locations in areas like 'street in city'.
Currently every type that has option 'INDEX' set in the map.ost file is indexed as location. Areas are currently build by scanning administrative boundaries and the various sized city typed locations and areas.
|
default |
|
virtualdefault |
void osmscout::LocationIndex::DumpStatistics | ( | ) | const |
References osmscout::Log::Info(), and osmscout::log.
void osmscout::LocationIndex::FlushCache | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool osmscout::LocationIndex::IsLocationIgnoreToken | ( | const std::string & | token | ) | const |
bool osmscout::LocationIndex::IsRegionIgnoreToken | ( | const std::string & | token | ) | const |
bool osmscout::LocationIndex::Load | ( | const std::string & | path, |
bool | memoryMappedData | ||
) |
References osmscout::Log::Error(), osmscout::IOException::GetDescription(), and osmscout::log.
bool osmscout::LocationIndex::ResolveAdminRegionHierachie | ( | const AdminRegionRef & | region, |
std::map< FileOffset, AdminRegionRef > & | refs | ||
) | const |
bool osmscout::LocationIndex::VisitAddresses | ( | const AdminRegion & | region, |
const PostalArea & | postalArea, | ||
const Location & | location, | ||
AddressVisitor & | visitor | ||
) | const |
Visit all addresses for a given location (in a given AdminRegion)
References osmscout::Log::Error(), osmscout::IOException::GetDescription(), and osmscout::log.
bool osmscout::LocationIndex::VisitAdminRegions | ( | AdminRegionVisitor & | visitor | ) | const |
Visit all admin regions.
References osmscout::AdminRegionVisitor::error, osmscout::Log::Error(), osmscout::IOException::GetDescription(), osmscout::log, and osmscout::AdminRegionVisitor::stop.
bool osmscout::LocationIndex::VisitAdminRegions | ( | const AdminRegion & | adminRegion, |
AdminRegionVisitor & | visitor | ||
) | const |
Visit given admin region and all sub regions.
References osmscout::Log::Error(), osmscout::IOException::GetDescription(), and osmscout::log.
bool osmscout::LocationIndex::VisitLocations | ( | const AdminRegion & | adminRegion, |
const PostalArea & | postalArea, | ||
LocationVisitor & | visitor, | ||
bool | recursive = true |
||
) | const |
Visit all locations within the given admin region and postal region.
References osmscout::Log::Error(), osmscout::IOException::GetDescription(), and osmscout::log.
bool osmscout::LocationIndex::VisitLocations | ( | const AdminRegion & | adminRegion, |
LocationVisitor & | visitor, | ||
bool | recursive = true |
||
) | const |
Visit all locations within the given admin region and its children.
References osmscout::Log::Error(), osmscout::IOException::GetDescription(), and osmscout::log.
bool osmscout::LocationIndex::VisitPOIs | ( | const AdminRegion & | region, |
POIVisitor & | visitor, | ||
bool | recursive = true |
||
) | const |
Visit all POIs within the given admin region.
References osmscout::Log::Error(), osmscout::IOException::GetDescription(), osmscout::log, and osmscout::AdminRegion::regionOffset.
|
static |