libosmscout
0.1
|
#include <LocationDescriptionService.h>
Classes | |
struct | ReverseLookupResult |
Public Types | |
using | ReverseLookupRef = std::shared_ptr< ReverseLookupResult > |
Public Member Functions | |
bool | DescribeLocation (const GeoCoord &location, LocationDescription &description, const Distance &lookupDistance=Distance::Of< Meter >(100), double sizeFilter=1.0) |
bool | DescribeLocationByAddress (const GeoCoord &location, LocationDescription &description, const Distance &lookupDistance=Distance::Of< Meter >(100), double sizeFilter=1.0) |
bool | DescribeLocationByCrossing (const GeoCoord &location, LocationDescription &description, const Distance &lookupDistance=Distance::Of< Meter >(100)) |
Returns crossings (of roads that can be driven by cars and which have a name feature) More... | |
bool | DescribeLocationByName (const GeoCoord &location, LocationDescription &description, const Distance &lookupDistance=Distance::Of< Meter >(100), double sizeFilter=1.0) |
bool | DescribeLocationByPOI (const GeoCoord &location, LocationDescription &description, const Distance &lookupDistance=Distance::Of< Meter >(100), double sizeFilter=1.0) |
bool | DescribeLocationByWay (const GeoCoord &location, LocationDescription &description, const Distance &lookupDistance=Distance::Of< Meter >(100)) |
Returns ways (roads that can be driven by cars and which have a name feature) More... | |
LocationDescriptionService (const DatabaseRef &database) | |
LocationService constructor. More... | |
bool | ReverseLookupObject (const ObjectFileRef &object, std::list< ReverseLookupResult > &result) const |
Lookup one object. More... | |
bool | ReverseLookupObjects (const std::list< ObjectFileRef > &objects, std::list< ReverseLookupResult > &result) const |
Lookups location descriptions for the given objects. More... | |
bool | ReverseLookupRegion (const GeoCoord &coord, std::list< ReverseLookupResult > &result) const |
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:
using osmscout::LocationDescriptionService::ReverseLookupRef = std::shared_ptr<ReverseLookupResult> |
|
explicit |
LocationService constructor.
database | Valid reference to a db instance |
bool osmscout::LocationDescriptionService::DescribeLocation | ( | const GeoCoord & | location, |
LocationDescription & | description, | ||
const Distance & | lookupDistance = Distance::Of<Meter>(100) , |
||
double | sizeFilter = 1.0 |
||
) |
bool osmscout::LocationDescriptionService::DescribeLocationByAddress | ( | const GeoCoord & | location, |
LocationDescription & | description, | ||
const Distance & | lookupDistance = Distance::Of<Meter>(100) , |
||
double | sizeFilter = 1.0 |
||
) |
bool osmscout::LocationDescriptionService::DescribeLocationByCrossing | ( | const GeoCoord & | location, |
LocationDescription & | description, | ||
const Distance & | lookupDistance = Distance::Of<Meter>(100) |
||
) |
Returns crossings (of roads that can be driven by cars and which have a name feature)
location | Location to search for the closest crossing |
description | The description returned |
lookupDistance | The range to look in |
References osmscout::TypeInfoSet::Empty(), osmscout::Point::GetCoord(), osmscout::GetEllipsoidalDistance(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::GetSphericalBearingInitial(), osmscout::WayRegionSearchResult::GetWayResults(), osmscout::Point::IsIdentical(), osmscout::Distance::Max(), osmscout::NameFeature::NAME, ReverseLookupObject(), osmscout::TypeInfoSet::Set(), and osmscout::LocationDescription::SetCrossingDescription().
Referenced by DescribeLocation().
bool osmscout::LocationDescriptionService::DescribeLocationByName | ( | const GeoCoord & | location, |
LocationDescription & | description, | ||
const Distance & | lookupDistance = Distance::Of<Meter>(100) , |
||
double | sizeFilter = 1.0 |
||
) |
bool osmscout::LocationDescriptionService::DescribeLocationByPOI | ( | const GeoCoord & | location, |
LocationDescription & | description, | ||
const Distance & | lookupDistance = Distance::Of<Meter>(100) , |
||
double | sizeFilter = 1.0 |
||
) |
bool osmscout::LocationDescriptionService::DescribeLocationByWay | ( | const GeoCoord & | location, |
LocationDescription & | description, | ||
const Distance & | lookupDistance = Distance::Of<Meter>(100) |
||
) |
Returns ways (roads that can be driven by cars and which have a name feature)
location | Location to search for the closest ways |
description | The description returned |
lookupDistance | The range to look in |
References osmscout::DistanceToSegment(), osmscout::TypeInfoSet::Empty(), osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), osmscout::GetSphericalDistance(), osmscout::WayRegionSearchResult::GetWayResults(), osmscout::Distance::Max(), osmscout::NameFeature::NAME, osmscout::RefFeature::NAME, ReverseLookupObject(), osmscout::TypeInfoSet::Set(), and osmscout::LocationDescription::SetWayDescription().
Referenced by DescribeLocation().
bool osmscout::LocationDescriptionService::ReverseLookupObject | ( | const ObjectFileRef & | object, |
std::list< ReverseLookupResult > & | result | ||
) | const |
Lookup one object.
object | The object to lookup |
result | List of results. The list may hold none, one or more entries for the object |
References ReverseLookupObjects().
Referenced by DescribeLocationByAddress(), DescribeLocationByCrossing(), DescribeLocationByName(), DescribeLocationByPOI(), and DescribeLocationByWay().
bool osmscout::LocationDescriptionService::ReverseLookupObjects | ( | const std::list< ObjectFileRef > & | objects, |
std::list< ReverseLookupResult > & | result | ||
) | const |
Lookups location descriptions for the given objects.
objects | List of objects |
result | List of results. The list may hold none, one or more entries for each object. |
References osmscout::refArea, osmscout::refNode, and osmscout::refWay.
Referenced by ReverseLookupObject().
bool osmscout::LocationDescriptionService::ReverseLookupRegion | ( | const GeoCoord & | coord, |
std::list< ReverseLookupResult > & | result | ||
) | const |