libosmscout
0.1
|
#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. More... | |
GeoBox ()=default | |
The default constructor creates an invalid instance. More... | |
GeoBox (const GeoBox &other)=default | |
Copy-Constructor. More... | |
GeoBox (const GeoCoord &coordA, const GeoCoord &coordB) | |
Initialize the GeoBox based on the given coordinates. More... | |
GeoCoord | GetBottomLeft () const |
south-west corner More... | |
GeoCoord | GetBottomRight () const |
south-east corner More... | |
GeoCoord | GetCenter () const |
std::string | GetDisplayText () const |
Return a string representation of the coordinate value in a human readable format. More... | |
double | GetHeight () const |
Returns the height of the bounding box (maxLat-minLat). More... | |
GeoCoord | GetMaxCoord () const |
Return the coordinate with the maximum value for the lat/lon values of the area. More... | |
double | GetMaxLat () const |
Return the maximum latitude of the GeBox. More... | |
double | GetMaxLon () const |
Return the maximum longitude of the GeBox. More... | |
GeoCoord | GetMinCoord () const |
Return the coordinate with the minimum value for the lat/lon values of the area. More... | |
double | GetMinLat () const |
Return the minimum latitude of the GeBox. More... | |
double | GetMinLon () const |
Return the minimum longitude of the GeBox. More... | |
double | GetSize () const |
Returns the size of the bounding box (width*height). More... | |
GeoCoord | GetTopLeft () const |
north-west corner More... | |
GeoCoord | GetTopRight () const |
north-east corner More... | |
double | GetWidth () const |
Returns the width of the bounding box (maxLon-minLon). More... | |
void | Include (const GeoBox &other) |
Resize the bounding box to include the original bounding box and the given bounding box. More... | |
void | Include (const GeoCoord &point) |
Resize the bounding box to include the original bounding box and the given point. More... | |
template<typename P > | |
bool | Includes (const P &coord, bool openInterval=true) const |
Returns 'true' if coordinate is within the bounding box. More... | |
GeoBox | Intersection (const GeoBox &other) const |
Create new GeoBox from intersection of this with other If not Intersects, invalid GeoBox is returned. More... | |
bool | Intersects (const GeoBox &other, bool openInterval=true) const |
Returns true, if both GeoBox instances intersect with each other. More... | |
void | Invalidate () |
Invalidate the bounding Box. More... | |
bool | IsValid () const |
Returns true, if the GeoBox instance is valid. More... | |
bool | operator!= (const GeoBox &other) const |
GeoBox & | operator= (const GeoBox &other)=default |
Assign the value of other. More... | |
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. More... | |
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. More... | |
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.
|
default |
Copy-Constructor.
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(), 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(), and osmscout::PositionAgent::Process().
Create new GeoBox to is cropped to the bounds of the passed geo box.
other |
References GetMaxLat(), GetMaxLon(), GetMinLat(), and GetMinLon().
Referenced by osmscout::MercatorProjection::Set().
|
inline |
south-west corner
Referenced by osmscout::DistanceToSegment(), osmscout::MapPainter::DrawContourLines(), and osmscout::TileIdBox::GetBoundingBox().
|
inline |
south-east corner
References osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().
Referenced by osmscout::DistanceToSegment(), and osmscout::MapPainter::DrawContourLines().
GeoCoord osmscout::GeoBox::GetCenter | ( | ) | const |
References osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().
Referenced by osmscout::MapPainter::DrawHillShading(), osmscout::OverlayObject::getBBoxAsLocation(), osmscout::DescriptionService::GetDescription(), osmscout::SearchRunnable::GetObjectDetails(), osmscout::Database::LoadAreasInArea(), osmscout::Database::LoadNodesInArea(), osmscout::Database::LoadWaysInArea(), osmscout::LocationEntry::mergeWith(), 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.
References osmscout::GeoCoord::GetDisplayText().
Referenced by osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::DescriptionService::GetDescription(), osmscout::SRTM::GetHeightInBoundingBox(), osmscout::AreaIndex::GetOffsets(), osmscout::AreaNodeIndex::GetOffsets(), and osmscout::BoundingBoxDataFile::Load().
|
inline |
Returns the height of the bounding box (maxLat-minLat).
References osmscout::GeoCoord::GetLat().
Referenced by osmscout::CalculateCellLevel(), and osmscout::PolygonCenter().
|
inline |
Return the coordinate with the maximum value for the lat/lon values of the area.
Referenced by osmscout::AreaSorter(), osmscout::Projection::BoundingBoxToPixel(), osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::MapTileCache< T >::GetTilesForBoundingBox(), osmscout::DataTileCache::GetTilesForBoundingBox(), Include(), operator!=(), operator==(), osmscout::MapWidget::recenter(), osmscout::MapWidget::showLocation(), and osmscout::FileWriter::WriteBox().
|
inline |
Return the maximum latitude of the GeBox.
References osmscout::GeoCoord::GetLat().
Referenced by osmscout::Projection::BoundingBoxToPixel(), 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.
References osmscout::GeoCoord::GetLon().
Referenced by osmscout::Projection::BoundingBoxToPixel(), CropTo(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::WaterIndex::GetRegions(), Intersection(), Intersects(), osmscout::PolygonCenter(), osmscout::TileProjection::SetInternal(), and osmscout::TransformBoundingBox().
|
inline |
Return the coordinate with the minimum value for the lat/lon values of the area.
Referenced by osmscout::AreaSorter(), osmscout::Projection::BoundingBoxToPixel(), osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::SRTM::GetHeightInBoundingBox(), osmscout::MapTileCache< T >::GetTilesForBoundingBox(), osmscout::DataTileCache::GetTilesForBoundingBox(), Include(), operator!=(), operator==(), osmscout::PolygonCenter(), osmscout::MapWidget::recenter(), osmscout::MapWidget::showLocation(), and osmscout::FileWriter::WriteBox().
|
inline |
Return the minimum latitude of the GeBox.
References osmscout::GeoCoord::GetLat().
Referenced by osmscout::Projection::BoundingBoxToPixel(), CropTo(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::WaterIndex::GetRegions(), Intersection(), Intersects(), osmscout::PolygonCenter(), osmscout::TileProjection::SetInternal(), and osmscout::TransformBoundingBox().
|
inline |
Return the minimum longitude of the GeBox.
References osmscout::GeoCoord::GetLon().
Referenced by osmscout::Projection::BoundingBoxToPixel(), CropTo(), osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::AreaAreaIndex::GetAreasInArea(), osmscout::WaterIndex::GetRegions(), Intersection(), Intersects(), osmscout::PolygonCenter(), osmscout::TiledRenderingHelper::RenderTiles(), osmscout::TileProjection::SetInternal(), and osmscout::TransformBoundingBox().
|
inline |
Returns the size of the bounding box (width*height).
|
inline |
north-west corner
References osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().
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).
References osmscout::GeoCoord::GetLon().
Referenced by osmscout::CalculateCellLevel(), 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 osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), GetMaxCoord(), GetMinCoord(), and osmscout::GeoCoord::Set().
Referenced by osmscout::GetBoundingBox(), osmscout::Area::GetBoundingBox(), osmscout::SearchRunnable::GetObjectDetails(), osmscout::LocationEntry::mergeWith(), osmscout::MapRenderer::overlayObjectsBox(), osmscout::PositionAgent::Process(), and osmscout::MercatorProjection::Set().
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(), osmscout::GeoCoord::GetLon(), and osmscout::GeoCoord::Set().
|
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. |
References osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().
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 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 osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), 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.
References osmscout::GeoCoord::Set().
Referenced by osmscout::OverlayObject::addPoint(), osmscout::OverlayObject::clear(), 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::OverlayObject::boundingBoxInternal(), osmscout::Projection::BoundingBoxToPixel(), osmscout::Way::GetBoundingBox(), 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 GetMaxCoord(), and GetMinCoord().
|
inline |
References GetMaxCoord(), and GetMinCoord().
Assign a new rectangular area bases an two coordinates defining the bounds.
References osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), and osmscout::GeoCoord::Set().
Referenced by osmscout::FindIntersection(), osmscout::FindPathIntersections(), osmscout::GetBoundingBox(), and osmscout::GetSegmentBoundingBox().