|
libosmscout 0.1
|
Central access class to all the individual data files and indexes. More...
#include <Database.h>
Public Member Functions | |
| void | Close () |
| Database (const DatabaseParameter ¶meter) | |
| void | DumpStatistics () const |
| void | FlushCache () |
| AreaAreaIndexRef | GetAreaAreaIndex () const |
| bool | GetAreaByOffset (const FileOffset &offset, AreaRef &area) const |
| AreaDataFileRef | GetAreaDataFile () const |
| AreaNodeIndexRef | GetAreaNodeIndex () const |
| AreaRouteIndexRef | GetAreaRouteIndex () const |
| bool | GetAreasByBlockSpan (const DataBlockSpan &span, std::vector< AreaRef > &area) const |
| bool | GetAreasByBlockSpans (const std::vector< DataBlockSpan > &spans, std::vector< AreaRef > &areas) const |
| template<typename OffsetsCol , typename DataCol > | |
| bool | GetAreasByOffset (const OffsetsCol &offsets, DataCol &areas) const |
| AreaWayIndexRef | GetAreaWayIndex () const |
| bool | GetBoundingBox (GeoBox &boundingBox) const |
| BoundingBoxDataFileRef | GetBoundingBoxDataFile () const |
| LocationIndexRef | GetLocationIndex () const |
| bool | GetNodeByOffset (const FileOffset &offset, NodeRef &node) const |
| NodeDataFileRef | GetNodeDataFile () const |
| bool | GetNodesByOffset (const std::list< FileOffset > &offsets, std::vector< NodeRef > &nodes) const |
| bool | GetNodesByOffset (const std::set< FileOffset > &offsets, std::unordered_map< FileOffset, NodeRef > &dataMap) const |
| bool | GetNodesByOffset (const std::set< FileOffset > &offsets, std::vector< NodeRef > &nodes) const |
| bool | GetNodesByOffset (const std::vector< FileOffset > &offsets, const GeoBox &boundingBox, std::vector< NodeRef > &nodes) const |
| bool | GetNodesByOffset (const std::vector< FileOffset > &offsets, std::vector< NodeRef > &nodes) const |
| OptimizeAreasLowZoomRef | GetOptimizeAreasLowZoom () const |
| OptimizeWaysLowZoomRef | GetOptimizeWaysLowZoom () const |
| const DatabaseParameter & | GetParameter () const |
| std::string | GetPath () const |
| RouteDataFileRef | GetRouteDataFile () const |
| template<typename OffsetsCol , typename DataCol > | |
| bool | GetRoutesByOffset (const OffsetsCol &offsets, DataCol &routes) const |
| SRTMRef | GetSRTMIndex () const |
| TypeConfigRef | GetTypeConfig () const |
| WaterIndexRef | GetWaterIndex () const |
| bool | GetWayByOffset (const FileOffset &offset, WayRef &way) const |
| WayDataFileRef | GetWayDataFile () const |
| template<typename OffsetsCol , typename DataCol > | |
| bool | GetWaysByOffset (const OffsetsCol &offsets, DataCol &ways) const |
| bool | IsOpen () const |
| AreaRegionSearchResult | LoadAreasInArea (const TypeInfoSet &types, const GeoBox &boundingBox) const |
| Load areas of given types in the given geo box. | |
| AreaRegionSearchResult | LoadAreasInRadius (const GeoCoord &location, const TypeInfoSet &types, Distance maxDistance=Distance::Of< Meter >(100)) const |
| Load areas of given types with maximum distance to the given coordinate. | |
| NodeRegionSearchResult | LoadNodesInArea (const TypeInfoSet &types, const GeoBox &boundingBox) const |
| Load nodes of given types in the given geo box Distance is measured in relation to the center of the bounding box. | |
| NodeRegionSearchResult | LoadNodesInRadius (const GeoCoord &location, const TypeInfoSet &types, Distance maxDistance=Distance::Of< Meter >(100)) const |
| Load nodes of given types with maximum distance to the given coordinate. | |
| WayRegionSearchResult | LoadWaysInArea (const TypeInfoSet &types, const GeoBox &boundingBox) const |
| Load ways of given types in the given geo box. | |
| WayRegionSearchResult | LoadWaysInRadius (const GeoCoord &location, const TypeInfoSet &types, Distance maxDistance=Distance::Of< Meter >(100)) const |
| Load ways of given types with maximum distance to the given coordinate. | |
| bool | Open (const std::string &path) |
| ~Database () | |
Static Public Member Functions | |
| static uint32_t | GetDatabaseFileFormatVersion (const std::string &path) |
| static uint32_t | GetLibraryFileFormatVersion () |
Central access class to all the individual data files and indexes.
A db is mainly initialized with a number of optional but performance relevant parameters.
The Database is opened by passing the directory that contains all db files.
|
explicit |
References osmscout::Log::Debug(), and osmscout::log.
| osmscout::Database::~Database | ( | ) |
References Close(), osmscout::Log::Debug(), IsOpen(), and osmscout::log.
| void osmscout::Database::Close | ( | ) |
Referenced by ~Database().
| void osmscout::Database::DumpStatistics | ( | ) | const |
| void osmscout::Database::FlushCache | ( | ) |
| AreaAreaIndexRef osmscout::Database::GetAreaAreaIndex | ( | ) | const |
References osmscout::Log::Debug(), osmscout::Log::Error(), osmscout::DatabaseParameter::GetAreaAreaIndexCacheSize(), osmscout::DatabaseParameter::GetIndexMMap(), IsOpen(), osmscout::log, osmscout::StopClock::ResultString(), and osmscout::StopClock::Stop().
Referenced by LoadAreasInArea(), and LoadAreasInRadius().
| bool osmscout::Database::GetAreaByOffset | ( | const FileOffset & | offset, |
| AreaRef & | area | ||
| ) | const |
| AreaDataFileRef osmscout::Database::GetAreaDataFile | ( | ) | const |
References osmscout::Log::Debug(), osmscout::Log::Error(), osmscout::DatabaseParameter::GetAreaDataCacheSize(), osmscout::DatabaseParameter::GetAreasDataMMap(), IsOpen(), osmscout::log, osmscout::StopClock::ResultString(), and osmscout::StopClock::Stop().
Referenced by GetAreaByOffset(), GetAreasByBlockSpan(), and GetAreasByBlockSpans().
| AreaNodeIndexRef osmscout::Database::GetAreaNodeIndex | ( | ) | const |
| AreaRouteIndexRef osmscout::Database::GetAreaRouteIndex | ( | ) | const |
| bool osmscout::Database::GetAreasByBlockSpan | ( | const DataBlockSpan & | span, |
| std::vector< AreaRef > & | area | ||
| ) | const |
References GetAreaDataFile().
| bool osmscout::Database::GetAreasByBlockSpans | ( | const std::vector< DataBlockSpan > & | spans, |
| std::vector< AreaRef > & | areas | ||
| ) | const |
References GetAreaDataFile().
Referenced by LoadAreasInArea(), and LoadAreasInRadius().
|
inline |
| AreaWayIndexRef osmscout::Database::GetAreaWayIndex | ( | ) | const |
| bool osmscout::Database::GetBoundingBox | ( | GeoBox & | boundingBox | ) | const |
References GetBoundingBoxDataFile().
| BoundingBoxDataFileRef osmscout::Database::GetBoundingBoxDataFile | ( | ) | const |
|
static |
|
static |
References osmscout::FILE_FORMAT_VERSION.
| LocationIndexRef osmscout::Database::GetLocationIndex | ( | ) | const |
| bool osmscout::Database::GetNodeByOffset | ( | const FileOffset & | offset, |
| NodeRef & | node | ||
| ) | const |
| NodeDataFileRef osmscout::Database::GetNodeDataFile | ( | ) | const |
References osmscout::Log::Debug(), osmscout::Log::Error(), osmscout::DatabaseParameter::GetNodeDataCacheSize(), osmscout::DatabaseParameter::GetNodesDataMMap(), IsOpen(), osmscout::log, osmscout::StopClock::ResultString(), and osmscout::StopClock::Stop().
Referenced by GetNodeByOffset(), GetNodesByOffset(), GetNodesByOffset(), GetNodesByOffset(), GetNodesByOffset(), and GetNodesByOffset().
| bool osmscout::Database::GetNodesByOffset | ( | const std::list< FileOffset > & | offsets, |
| std::vector< NodeRef > & | nodes | ||
| ) | const |
| bool osmscout::Database::GetNodesByOffset | ( | const std::set< FileOffset > & | offsets, |
| std::unordered_map< FileOffset, NodeRef > & | dataMap | ||
| ) | const |
| bool osmscout::Database::GetNodesByOffset | ( | const std::set< FileOffset > & | offsets, |
| std::vector< NodeRef > & | nodes | ||
| ) | const |
| bool osmscout::Database::GetNodesByOffset | ( | const std::vector< FileOffset > & | offsets, |
| const GeoBox & | boundingBox, | ||
| std::vector< NodeRef > & | nodes | ||
| ) | const |
| bool osmscout::Database::GetNodesByOffset | ( | const std::vector< FileOffset > & | offsets, |
| std::vector< NodeRef > & | nodes | ||
| ) | const |
References osmscout::StopClock::GetMilliseconds(), GetNodeDataFile(), osmscout::log, osmscout::StopClock::ResultString(), osmscout::StopClock::Stop(), and osmscout::Log::Warn().
Referenced by LoadNodesInArea(), and LoadNodesInRadius().
| OptimizeAreasLowZoomRef osmscout::Database::GetOptimizeAreasLowZoom | ( | ) | const |
| OptimizeWaysLowZoomRef osmscout::Database::GetOptimizeWaysLowZoom | ( | ) | const |
|
inline |
| std::string osmscout::Database::GetPath | ( | ) | const |
| RouteDataFileRef osmscout::Database::GetRouteDataFile | ( | ) | const |
|
inline |
| SRTMRef osmscout::Database::GetSRTMIndex | ( | ) | const |
| TypeConfigRef osmscout::Database::GetTypeConfig | ( | ) | const |
Referenced by osmscout::RoutePostprocessor::PostprocessRouteDescription().
| WaterIndexRef osmscout::Database::GetWaterIndex | ( | ) | const |
| bool osmscout::Database::GetWayByOffset | ( | const FileOffset & | offset, |
| WayRef & | way | ||
| ) | const |
| WayDataFileRef osmscout::Database::GetWayDataFile | ( | ) | const |
|
inline |
Referenced by LoadWaysInArea(), and LoadWaysInRadius().
| bool osmscout::Database::IsOpen | ( | ) | const |
| AreaRegionSearchResult osmscout::Database::LoadAreasInArea | ( | const TypeInfoSet & | types, |
| const GeoBox & | boundingBox | ||
| ) | const |
Load areas of given types in the given geo box.
Distance is measured in relation to the center of the bounding box
| types | Set of type to load candidates for |
| boundingBox | Geographic area to search in |
| OSMScoutException | in case of errors |
References osmscout::CalculateDistancePointToLineSegment(), GetAreaAreaIndex(), GetAreasByBlockSpans(), osmscout::GeoBox::GetCenter(), osmscout::GetEllipsoidalDistance(), osmscout::IsCoordInArea(), and osmscout::Distance::Max().
Referenced by osmscout::POIService::GetPOIsInArea().
| AreaRegionSearchResult osmscout::Database::LoadAreasInRadius | ( | const GeoCoord & | location, |
| const TypeInfoSet & | types, | ||
| Distance | maxDistance = Distance::Of<Meter>(100) |
||
| ) | const |
Load areas of given types with maximum distance to the given coordinate.
| location | Geo coordinate in the center of the given circle |
| types | Set of type to load conadidates for |
| maxDistance | - lookup distance in meters Maximum radius from center to search for |
| OSMScoutException | in case of errors |
References osmscout::GeoBox::BoxByCenterAndRadius(), osmscout::CalculateDistancePointToLineSegment(), GetAreaAreaIndex(), GetAreasByBlockSpans(), osmscout::GetEllipsoidalDistance(), osmscout::IsCoordInArea(), and osmscout::Distance::Max().
Referenced by osmscout::POIService::GetPOIsInRadius().
| NodeRegionSearchResult osmscout::Database::LoadNodesInArea | ( | const TypeInfoSet & | types, |
| const GeoBox & | boundingBox | ||
| ) | const |
Load nodes of given types in the given geo box Distance is measured in relation to the center of the bounding box.
| types | Set of type to load candidates for |
| boundingBox | Geographic area to search in |
| OSMScoutException | in case of errors |
References GetAreaNodeIndex(), osmscout::GeoBox::GetCenter(), osmscout::GetEllipsoidalDistance(), and GetNodesByOffset().
Referenced by osmscout::POIService::GetPOIsInArea().
| NodeRegionSearchResult osmscout::Database::LoadNodesInRadius | ( | const GeoCoord & | location, |
| const TypeInfoSet & | types, | ||
| Distance | maxDistance = Distance::Of<Meter>(100) |
||
| ) | const |
Load nodes of given types with maximum distance to the given coordinate.
| location | Geo coordinate in the center of the given circle |
| types | Set of type to load conadidates for |
| maxDistance | - lookup distance in meters Maximum radius from center to search for |
| OSMScoutException | in case of errors |
References osmscout::GeoBox::BoxByCenterAndRadius(), GetAreaNodeIndex(), osmscout::GetEllipsoidalDistance(), and GetNodesByOffset().
Referenced by osmscout::POIService::GetPOIsInRadius().
| WayRegionSearchResult osmscout::Database::LoadWaysInArea | ( | const TypeInfoSet & | types, |
| const GeoBox & | boundingBox | ||
| ) | const |
Load ways of given types in the given geo box.
Distance is measured in relation to the center of the bounding box
| types | Set of type to load candidates for |
| boundingBox | Geographic area to search in |
| OSMScoutException | in case of errors |
References osmscout::CalculateDistancePointToLineSegment(), GetAreaWayIndex(), osmscout::GeoBox::GetCenter(), osmscout::GetEllipsoidalDistance(), GetWaysByOffset(), and osmscout::Distance::Max().
Referenced by osmscout::POIService::GetPOIsInArea().
| WayRegionSearchResult osmscout::Database::LoadWaysInRadius | ( | const GeoCoord & | location, |
| const TypeInfoSet & | types, | ||
| Distance | maxDistance = Distance::Of<Meter>(100) |
||
| ) | const |
Load ways of given types with maximum distance to the given coordinate.
| location | Geo coordinate in the center of the given circle |
| types | Set of type to load conadidates for |
| maxDistance | - lookup distance in meters Maximum radius from center to search for |
| OSMScoutException | in case of errors |
References osmscout::GeoBox::BoxByCenterAndRadius(), osmscout::CalculateDistancePointToLineSegment(), GetAreaWayIndex(), osmscout::GetEllipsoidalDistance(), GetWaysByOffset(), and osmscout::Distance::Max().
Referenced by osmscout::POIService::GetPOIsInRadius().
| bool osmscout::Database::Open | ( | const std::string & | path | ) |
References osmscout::Log::Error(), and osmscout::log.