libosmscout  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
osmscout::LocationIndex Class Reference

Location index returns objects by names (the name should be changed). More...

#include <LocationIndex.h>

Public Member Functions

void DumpStatistics ()
 
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)
 
 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 VisitLocations (const AdminRegion &adminRegion, LocationVisitor &visitor) const
 Visit all locations within the given admin region and its children. 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 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

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

Member Function Documentation

void osmscout::LocationIndex::DumpStatistics ( )
uint32_t osmscout::LocationIndex::GetAddressMaxWords ( ) const
inline
const std::vector<std::string>& osmscout::LocationIndex::GetLocationIgnoreTokens ( ) const
inline
uint32_t osmscout::LocationIndex::GetLocationMaxWords ( ) const
inline
const std::vector<std::string>& osmscout::LocationIndex::GetPOIIgnoreTokens ( ) const
inline
uint32_t osmscout::LocationIndex::GetPOIMaxWords ( ) const
inline
const std::vector<std::string>& osmscout::LocationIndex::GetRegionIgnoreTokens ( ) const
inline
uint32_t osmscout::LocationIndex::GetRegionMaxWords ( ) const
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 osmscout::LocationIndex::VisitAddresses ( const AdminRegion region,
const PostalArea postalArea,
const Location location,
AddressVisitor visitor 
) const
bool osmscout::LocationIndex::VisitLocations ( const AdminRegion adminRegion,
LocationVisitor visitor 
) const

Visit all locations within the given admin region and its children.

References osmscout::AppendFileToDir(), osmscout::Log::Error(), FILENAME_LOCATION_IDX, 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::AppendFileToDir(), osmscout::Log::Error(), FILENAME_LOCATION_IDX, osmscout::IOException::GetDescription(), and osmscout::log.

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

Member Data Documentation

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

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