|
libosmscout 0.1
|
Anonymous geographic rectangular bounding box. More...
#include <GeoBox.h>
Public Member Functions | |
| GeoBox | CropTo (const GeoBox &other) const |
| Create new GeoBox to is cropped to the bounds of the passed geo box. | |
| GeoBox ()=default | |
| The default constructor creates an invalid instance. | |
| GeoBox (const GeoBox &other)=default | |
| Copy-Constructor. | |
| GeoBox (const GeoCoord &coordA, const GeoCoord &coordB) | |
| Initialize the GeoBox based on the given coordinates. | |
| GeoCoord | GetBottomLeft () const |
| south-west corner | |
| GeoCoord | GetBottomRight () const |
| south-east corner | |
| GeoCoord | GetCenter () const |
| std::string | GetDisplayText () const |
| Return a string representation of the coordinate value in a human readable format. | |
| double | GetHeight () const |
| Returns the height of the bounding box (maxLat-minLat). | |
| GeoCoord | GetMaxCoord () const |
| Return the coordinate with the maximum value for the lat/lon values of the area. | |
| double | GetMaxLat () const |
| Return the maximum latitude of the GeBox. | |
| double | GetMaxLon () const |
| Return the maximum longitude of the GeBox. | |
| GeoCoord | GetMinCoord () const |
| Return the coordinate with the minimum value for the lat/lon values of the area. | |
| double | GetMinLat () const |
| Return the minimum latitude of the GeBox. | |
| double | GetMinLon () const |
| Return the minimum longitude of the GeBox. | |
| double | GetSize () const |
| Returns the size of the bounding box (width*height). | |
| GeoCoord | GetTopLeft () const |
| north-west corner | |
| GeoCoord | GetTopRight () const |
| north-east corner | |
| double | GetWidth () const |
| Returns the width of the bounding box (maxLon-minLon). | |
| void | Include (const GeoBox &other) |
| Resize the bounding box to include the original bounding box and the given bounding box. | |
| void | Include (const GeoCoord &point) |
| Resize the bounding box to include the original bounding box and the given point. | |
| template<typename P> | |
| bool | Includes (const P &coord, bool openInterval=true) const |
| Returns 'true' if coordinate is within the bounding box. | |
| GeoBox | Intersection (const GeoBox &other) const |
| Create new GeoBox from intersection of this with other If not Intersects, invalid GeoBox is returned. | |
| bool | Intersects (const GeoBox &other, bool openInterval=true) const |
| Returns true, if both GeoBox instances intersect with each other. | |
| void | Invalidate () |
| Invalidate the bounding Box. | |
| bool | IsValid () const |
| Returns true, if the GeoBox instance is valid. | |
| bool | operator!= (const GeoBox &other) const |
| GeoBox & | operator= (const GeoBox &other)=default |
| Assign the value of other. | |
| bool | operator== (const GeoBox &other) const |
| void | Set (const GeoCoord &coordA, const GeoCoord &coordB) |
| Assign a new rectangular area bases an two coordinates defining the bounds. | |
Static Public Member Functions | |
| static GeoBox | BoxByCenterAndRadius (const GeoCoord ¢er, const Distance &radius) |
| Return an GeoBox based on the center and the radius [meters] of a circle around the center. | |
Anonymous geographic rectangular bounding box.
The bounding box is defined by two coordinates (type GeoCoord) that span a (in coordinate space) rectangular area.
|
default |
The default constructor creates an invalid instance.
Referenced by BoxByCenterAndRadius(), CropTo(), GeoBox(), Include(), Intersection(), Intersects(), operator!=(), operator=(), and operator==().
|
default |
Copy-Constructor.
References GeoBox().
Initialize the GeoBox based on the given coordinates.
The two Coordinates together span a rectangular (in coordinates, not on the sphere) area.
|
static |
Return an GeoBox based on the center and the radius [meters] of a circle around the center.
The resulting box will cross the circle in its corners.
References osmscout::Bearing::Degrees(), GeoBox(), osmscout::GetEllipsoidalDistance(), osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().
Referenced by osmscout::SimpleRoutingService::GetClosestRoutableNode(), osmscout::PositionAgent::GpsPosition::GetGeoBox(), osmscout::SearchRunnable::GetObjectDetails(), osmscout::Database::LoadAreasInRadius(), osmscout::Database::LoadNodesInRadius(), osmscout::Database::LoadWaysInRadius(), operator=(), and osmscout::PositionAgent::Process().
Create new GeoBox to is cropped to the bounds of the passed geo box.
| other |
References GeoBox(), GetMaxLat(), GetMaxLon(), GetMinLat(), and GetMinLon().
|
inline |
south-west corner
Referenced by osmscout::DistanceToSegment(), osmscout::MapPainter::DrawContourLines(), and osmscout::TileIdBox::GetBoundingBox().
|
inline |
south-east corner
Referenced by osmscout::DistanceToSegment(), and osmscout::MapPainter::DrawContourLines().
| GeoCoord osmscout::GeoBox::GetCenter | ( | ) | const |
Referenced by osmscout::MapPainter::DrawHillShading(), osmscout::OverlayObject::getBBoxAsLocation(), osmscout::DescriptionService::GetDescription(), osmscout::DescriptionService::GetDescription(), osmscout::SearchRunnable::GetObjectDetails(), osmscout::Database::LoadAreasInArea(), osmscout::Database::LoadNodesInArea(), osmscout::Database::LoadWaysInArea(), osmscout::PolygonCenter(), osmscout::MapWidget::recenter(), osmscout::SearchModule::SearchForLocations(), osmscout::TileProjection::SetInternal(), and osmscout::MapWidget::showLocation().
| std::string osmscout::GeoBox::GetDisplayText | ( | ) | const |
Return a string representation of the coordinate value in a human readable format.
Referenced by osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::DescriptionService::GetDescription(), osmscout::DescriptionService::GetDescription(), osmscout::SRTM::GetHeightInBoundingBox(), osmscout::AreaIndex::GetOffsets(), and osmscout::AreaNodeIndex::GetOffsets().
|
inline |
Returns the height of the bounding box (maxLat-minLat).
Referenced by osmscout::CalculateCellLevel(), GetSize(), and osmscout::PolygonCenter().
|
inline |
Return the coordinate with the maximum value for the lat/lon values of the area.
Referenced by osmscout::AreaSorter(), osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::DataTileCache::GetTilesForBoundingBox(), osmscout::MapTileCache< T >::GetTilesForBoundingBox(), Include(), operator!=(), operator==(), osmscout::MapWidget::recenter(), osmscout::MapWidget::showLocation(), and osmscout::FileWriter::WriteBox().
|
inline |
Return the maximum latitude of the GeBox.
Referenced by CropTo(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::WaterIndex::GetRegions(), Intersection(), Intersects(), osmscout::PolygonCenter(), osmscout::TiledRenderingHelper::RenderTiles(), and osmscout::TransformBoundingBox().
|
inline |
Return the maximum longitude of the GeBox.
Referenced by CropTo(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::WaterIndex::GetRegions(), Intersection(), Intersects(), osmscout::PolygonCenter(), and osmscout::TransformBoundingBox().
|
inline |
Return the coordinate with the minimum value for the lat/lon values of the area.
Referenced by osmscout::AreaSorter(), osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::SRTM::GetHeightInBoundingBox(), osmscout::DataTileCache::GetTilesForBoundingBox(), osmscout::MapTileCache< T >::GetTilesForBoundingBox(), Include(), operator!=(), operator==(), osmscout::PolygonCenter(), osmscout::MapWidget::recenter(), osmscout::MapWidget::showLocation(), and osmscout::FileWriter::WriteBox().
|
inline |
Return the minimum latitude of the GeBox.
Referenced by CropTo(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::WaterIndex::GetRegions(), Intersection(), Intersects(), osmscout::PolygonCenter(), and osmscout::TransformBoundingBox().
|
inline |
Return the minimum longitude of the GeBox.
Referenced by CropTo(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::WaterIndex::GetRegions(), Intersection(), Intersects(), osmscout::PolygonCenter(), osmscout::TiledRenderingHelper::RenderTiles(), and osmscout::TransformBoundingBox().
|
inline |
Returns the size of the bounding box (width*height).
References GetHeight(), and GetWidth().
Referenced by osmscout::EnsureSimple().
|
inline |
north-west corner
Referenced by osmscout::DistanceToSegment(), and osmscout::MapPainter::DrawContourLines().
|
inline |
north-east corner
Referenced by osmscout::DistanceToSegment(), and osmscout::MapPainter::DrawContourLines().
|
inline |
Returns the width of the bounding box (maxLon-minLon).
Referenced by osmscout::CalculateCellLevel(), GetSize(), and osmscout::PolygonCenter().
| void osmscout::GeoBox::Include | ( | const GeoBox & | other | ) |
Resize the bounding box to include the original bounding box and the given bounding box.
Changes the GeoBox to include the other bounding box, too (calculation of the common rectangular hull).
| other | Other geoBox to include, too |
References GeoBox(), osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), GetMaxCoord(), and GetMinCoord().
Referenced by osmscout::EnsureSimple(), osmscout::Area::GetBoundingBox(), osmscout::GetBoundingBox(), osmscout::GetBoundingBox(), osmscout::GetBoundingBox(), osmscout::GetBoundingBox(), osmscout::SearchRunnable::GetObjectDetails(), osmscout::MapRenderer::overlayObjectsBox(), and osmscout::PositionAgent::Process().
| void osmscout::GeoBox::Include | ( | const GeoCoord & | point | ) |
Resize the bounding box to include the original bounding box and the given point.
References osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().
|
inline |
Returns 'true' if coordinate is within the bounding box.
| other | GeoCoord to check for inclusion |
| openInterval | If true, an open interval for the GeoBox is assumed else a closed interval. |
Referenced by osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::GetLineIntersection(), osmscout::Node::Intersects(), osmscout::IsAreaAtLeastPartlyInArea(), osmscout::MapWidget::isInDatabaseBoundingBox(), osmscout::LinesIntersect(), osmscout::LookupModule::requestLocationDescription(), osmscout::LookupModule::requestRegionLookup(), and osmscout::SearchModule::SearchForLocations().
Create new GeoBox from intersection of this with other If not Intersects, invalid GeoBox is returned.
| other |
References GeoBox(), GetMaxLat(), GetMaxLon(), GetMinLat(), GetMinLon(), and Intersects().
Referenced by osmscout::SRTM::GetHeightInBoundingBox().
|
inline |
Returns true, if both GeoBox instances intersect with each other.
| other | Other instance to compare against |
| openInterval | If true, an open interval for this GeoBox is assumed else a closed interval. |
References GeoBox(), GetMaxLat(), GetMaxLon(), GetMinLat(), and GetMinLon().
Referenced by osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::FindPathIntersections(), osmscout::AreaIndex::GetOffsets(), osmscout::AreaNodeIndex::GetOffsets(), osmscout::MapRenderer::getOverlayObjects(), Intersection(), osmscout::TileCache::invalidate(), osmscout::IsAreaAtLeastPartlyInArea(), and osmscout::DBLoadJob::Run().
|
inline |
Invalidate the bounding Box.
Referenced by osmscout::GetBoundingBox(), osmscout::GetBoundingBox(), and osmscout::GetSegmentBoundingBox().
|
inline |
Returns true, if the GeoBox instance is valid.
This means there were values assigned to the box. While being valid, the rectangle spanned by the coordinate might still be degraded.
Referenced by osmscout::TileCache::invalidate(), osmscout::MapWidget::isDatabaseLoaded(), osmscout::MapWidget::isInDatabaseBoundingBox(), osmscout::MapPainter::IsVisibleArea(), osmscout::MapRenderer::overlayObjectsBox(), osmscout::MapWidget::recenter(), osmscout::MapWidget::showLocation(), and osmscout::FileWriter::WriteBox().
|
inline |
References GeoBox(), GetMaxCoord(), and GetMinCoord().
Assign the value of other.
References BoxByCenterAndRadius(), and GeoBox().
|
inline |
References GeoBox(), GetMaxCoord(), and GetMinCoord().
Assign a new rectangular area bases an two coordinates defining the bounds.
References osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().
Referenced by osmscout::FindIntersection(), osmscout::FindPathIntersections(), osmscout::GetBoundingBox(), osmscout::GetSegmentBoundingBox(), and osmscout::AreaNodeIndex::Open().