|
libosmscout 0.1
|
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). More...
#include <LocationDescriptionService.h>
Classes | |
| struct | ReverseLookupResult |
| Result of a location reverse lookup. More... | |
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) | |
| 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) | |
| LocationDescriptionService (const DatabaseRef &database) | |
| LocationService constructor. | |
| bool | ReverseLookupObject (const ObjectFileRef &object, std::list< ReverseLookupResult > &result) const |
| Lookup one object. | |
| bool | ReverseLookupObjects (const std::list< ObjectFileRef > &objects, std::list< ReverseLookupResult > &result) const |
| Lookups location descriptions for the given objects. | |
| 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 bearing, osmscout::TypeInfoSet::Empty(), osmscout::GetEllipsoidalDistance(), osmscout::GetSphericalBearingInitial(), osmscout::WayRegionSearchResult::GetWayResults(), 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 |