libosmscout  0.1
osmscout::LocationIndex Class Reference

#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 &region, std::map< FileOffset, AdminRegionRef > &refs) const
 
bool VisitAddresses (const AdminRegion &region, 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 &region, 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"
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LocationIndex()

osmscout::LocationIndex::LocationIndex ( )
default

◆ ~LocationIndex()

virtual osmscout::LocationIndex::~LocationIndex ( )
virtualdefault

Member Function Documentation

◆ DumpStatistics()

void osmscout::LocationIndex::DumpStatistics ( ) const

◆ FlushCache()

void osmscout::LocationIndex::FlushCache ( ) const

◆ GetAddressMaxWords()

uint32_t osmscout::LocationIndex::GetAddressMaxWords ( ) const
inline

◆ GetLocationIgnoreTokens()

const std::vector<std::string>& osmscout::LocationIndex::GetLocationIgnoreTokens ( ) const
inline

◆ GetLocationMaxWords()

uint32_t osmscout::LocationIndex::GetLocationMaxWords ( ) const
inline

◆ GetPOIIgnoreTokens()

const std::vector<std::string>& osmscout::LocationIndex::GetPOIIgnoreTokens ( ) const
inline

◆ GetPOIMaxWords()

uint32_t osmscout::LocationIndex::GetPOIMaxWords ( ) const
inline

◆ GetRegionIgnoreTokens()

const std::vector<std::string>& osmscout::LocationIndex::GetRegionIgnoreTokens ( ) const
inline

◆ GetRegionMaxWords()

uint32_t osmscout::LocationIndex::GetRegionMaxWords ( ) const
inline

◆ IsLocationIgnoreToken()

bool osmscout::LocationIndex::IsLocationIgnoreToken ( const std::string &  token) const

◆ IsRegionIgnoreToken()

bool osmscout::LocationIndex::IsRegionIgnoreToken ( const std::string &  token) const

◆ Load()

bool osmscout::LocationIndex::Load ( const std::string &  path,
bool  memoryMappedData 
)

◆ ResolveAdminRegionHierachie()

bool osmscout::LocationIndex::ResolveAdminRegionHierachie ( const AdminRegionRef region,
std::map< FileOffset, AdminRegionRef > &  refs 
) const

◆ VisitAddresses()

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.

◆ VisitAdminRegions() [1/2]

bool osmscout::LocationIndex::VisitAdminRegions ( AdminRegionVisitor visitor) const

◆ VisitAdminRegions() [2/2]

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.

◆ VisitLocations() [1/2]

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.

◆ VisitLocations() [2/2]

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.

◆ VisitPOIs()

bool osmscout::LocationIndex::VisitPOIs ( const AdminRegion region,
POIVisitor visitor,
bool  recursive = true 
) const

Member Data Documentation

◆ FILENAME_LOCATION_IDX

const char *const osmscout::LocationIndex::FILENAME_LOCATION_IDX = "location.idx"
static

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