libosmscout
0.1
|
#include <LocationService.h>
Public Member Functions | |
LocationService (const DatabaseRef &database) | |
LocationService constructor. More... | |
bool | ResolveAdminRegionHierachie (const AdminRegionRef &adminRegion, std::map< FileOffset, AdminRegionRef > &refs) const |
Resolve all parent regions of the given region (walk the region tree up to the root)Use AdminRegion::regionOffset and AdminRegion::parentRegionOffset to build the tree. More... | |
bool | SearchForLocationByForm (const LocationFormSearchParameter &searchParameter, LocationSearchResult &result) const |
bool | SearchForLocationByString (const LocationStringSearchParameter &searchParameter, LocationSearchResult &result) const |
bool | SearchForPOIByForm (const POIFormSearchParameter &searchParameter, LocationSearchResult &result) const |
bool | VisitAdminRegionLocations (const AdminRegion ®ion, const PostalArea &postalArea, LocationVisitor &visitor) const |
Visit the location at the given region and all its sub regions. More... | |
bool | VisitAdminRegionPOIs (const AdminRegion ®ion, POIVisitor &visitor) const |
Visit the POIs at the given region and all its sub regions. More... | |
bool | VisitAdminRegions (AdminRegionVisitor &visitor) const |
Call the given visitor for each region in the index (deep first) More... | |
bool | VisitLocationAddresses (const AdminRegion ®ion, const PostalArea &postalArea, const Location &location, AddressVisitor &visitor) const |
Visit all addresses at the given location. More... | |
The LocationService offers a number of methods for location lookup ( search for a certain location by its name) and location reverse lookup (retrieve the name of a location).
The support different type of requests for different interfaces the visitor pattern is used.
Currently the following functionalities are supported:
|
explicit |
LocationService constructor.
database | Valid reference to a db instance |
bool osmscout::LocationService::ResolveAdminRegionHierachie | ( | const AdminRegionRef & | adminRegion, |
std::map< FileOffset, AdminRegionRef > & | refs | ||
) | const |
Resolve all parent regions of the given region (walk the region tree up to the root)Use AdminRegion::regionOffset and AdminRegion::parentRegionOffset to build the tree.
adminRegion | The region to start at |
refs | A map of all parent regions |
bool osmscout::LocationService::SearchForLocationByForm | ( | const LocationFormSearchParameter & | searchParameter, |
LocationSearchResult & | result | ||
) | const |
References osmscout::AddRegionResult(), osmscout::LocationSearchResult::candidate, osmscout::Log::Debug(), osmscout::LocationFormSearchParameter::GetAddressOnlyMatch(), osmscout::LocationFormSearchParameter::GetAddressSearchString(), osmscout::LocationFormSearchParameter::GetAdminRegionOnlyMatch(), osmscout::LocationFormSearchParameter::GetAdminRegionSearchString(), osmscout::LocationFormSearchParameter::GetBreaker(), osmscout::LocationFormSearchParameter::GetLimit(), osmscout::LocationFormSearchParameter::GetLocationOnlyMatch(), osmscout::LocationFormSearchParameter::GetLocationSearchString(), osmscout::LocationFormSearchParameter::GetPartialMatch(), osmscout::LocationFormSearchParameter::GetPostalAreaOnlyMatch(), osmscout::LocationFormSearchParameter::GetPostalAreaSearchString(), osmscout::LocationFormSearchParameter::GetStringMatcherFactory(), osmscout::LocationFormSearchParameter::IsAborted(), osmscout::LocationSearchResult::limitReached, osmscout::log, osmscout::LocationSearchResult::match, osmscout::LocationSearchResult::results, osmscout::SearchForPostalAreaForRegion(), and osmscout::UTF8StringToUpper().
bool osmscout::LocationService::SearchForLocationByString | ( | const LocationStringSearchParameter & | searchParameter, |
LocationSearchResult & | result | ||
) | const |
References osmscout::AddRegionResult(), osmscout::BuildStringListFromSubToken(), osmscout::LocationSearchResult::candidate, osmscout::CleanupSearchPatterns(), osmscout::Log::Debug(), osmscout::GenerateSearchPatterns(), osmscout::LocationStringSearchParameter::GetAddressOnlyMatch(), osmscout::LocationStringSearchParameter::GetAdminRegionOnlyMatch(), osmscout::LocationStringSearchParameter::GetBreaker(), osmscout::LocationStringSearchParameter::GetDefaultAdminRegion(), osmscout::LocationStringSearchParameter::GetLimit(), osmscout::LocationStringSearchParameter::GetLocationOnlyMatch(), osmscout::LocationStringSearchParameter::GetPartialMatch(), osmscout::LocationStringSearchParameter::GetPOIOnlyMatch(), osmscout::LocationStringSearchParameter::GetSearchForLocation(), osmscout::LocationStringSearchParameter::GetSearchForPOI(), osmscout::LocationStringSearchParameter::GetSearchString(), osmscout::LocationStringSearchParameter::GetStringMatcherFactory(), osmscout::LocationStringSearchParameter::IsAborted(), osmscout::LocationSearchResult::limitReached, osmscout::log, osmscout::LocationSearchResult::match, osmscout::LocationSearchResult::results, osmscout::StopClock::ResultString(), osmscout::SearchForLocationForRegion(), osmscout::SearchForPOIForRegion(), osmscout::StopClock::Stop(), osmscout::TokenizeString(), and osmscout::UTF8StringToUpper().
bool osmscout::LocationService::SearchForPOIByForm | ( | const POIFormSearchParameter & | searchParameter, |
LocationSearchResult & | result | ||
) | const |
References osmscout::AddRegionResult(), osmscout::LocationSearchResult::candidate, osmscout::Log::Debug(), osmscout::POIFormSearchParameter::GetAdminRegionOnlyMatch(), osmscout::POIFormSearchParameter::GetAdminRegionSearchString(), osmscout::POIFormSearchParameter::GetBreaker(), osmscout::POIFormSearchParameter::GetLimit(), osmscout::POIFormSearchParameter::GetPartialMatch(), osmscout::POIFormSearchParameter::GetPOIOnlyMatch(), osmscout::POIFormSearchParameter::GetPOISearchString(), osmscout::POIFormSearchParameter::GetStringMatcherFactory(), osmscout::POIFormSearchParameter::IsAborted(), osmscout::LocationSearchResult::limitReached, osmscout::log, osmscout::LocationSearchResult::match, osmscout::LocationSearchResult::results, osmscout::SearchForPOIForRegion(), and osmscout::UTF8StringToUpper().
bool osmscout::LocationService::VisitAdminRegionLocations | ( | const AdminRegion & | region, |
const PostalArea & | postalArea, | ||
LocationVisitor & | visitor | ||
) | const |
Visit the location at the given region and all its sub regions.
region | Region to start at |
visitor | Visitor |
bool osmscout::LocationService::VisitAdminRegionPOIs | ( | const AdminRegion & | region, |
POIVisitor & | visitor | ||
) | const |
Visit the POIs at the given region and all its sub regions.
region | Region to start at |
visitor | Visitor |
bool osmscout::LocationService::VisitAdminRegions | ( | AdminRegionVisitor & | visitor | ) | const |
Call the given visitor for each region in the index (deep first)
visitor | The visitor |
bool osmscout::LocationService::VisitLocationAddresses | ( | const AdminRegion & | region, |
const PostalArea & | postalArea, | ||
const Location & | location, | ||
AddressVisitor & | visitor | ||
) | const |
Visit all addresses at the given location.
region | Region the location belongs to |
location | The location itself |
visitor | The Visitor |