olp-cpp-sdk  1.22.0
Public Member Functions | Protected Attributes | List of all members
olp::geo::GeoRectangle Class Reference

A rectangular area in the WGS84 Coordinate System. More...

#include <GeoRectangle.h>

Collaboration diagram for olp::geo::GeoRectangle:
Collaboration graph
[legend]

Public Member Functions

 GeoRectangle ()
 Creates an empty rectangle.
 
 GeoRectangle (const GeoCoordinates &south_west, const GeoCoordinates &north_east)
 Creates a GeoRectangle instance. More...
 
GeoCoordinates SouthEast () const
 Computes the southeast corner of the rectangle. More...
 
GeoCoordinates SouthWest () const
 Computes the southwest corner of the rectangle. More...
 
GeoCoordinates NorthEast () const
 Computes the northeast corner of the rectangle. More...
 
GeoCoordinates NorthWest () const
 Computes the northwest corner of the rectangle. More...
 
GeoCoordinates Center () const
 Computes the center of the rectangle. More...
 
bool IsEmpty () const
 Checks whether the rectangle is empty. More...
 
double LongitudeSpan () const
 Gets the longitude span of the rectangle. More...
 
double LatitudeSpan () const
 Gets the latitude span of the rectangle. More...
 
bool Contains (const GeoCoordinates &point) const
 Checks whether the coordinates contain a point. More...
 
bool Overlaps (const GeoRectangle &rectangle) const
 Checks whether two rectangles overlap. More...
 
bool operator== (const GeoRectangle &other) const
 Checks whether two rectangles are equal. More...
 
bool operator!= (const GeoRectangle &other) const
 Checks whether two rectangles are not equal. More...
 
GeoRectangle BooleanUnion (const GeoRectangle &other) const
 Unites two regtangles that have shared areas. More...
 
GeoRectangleGrowToContain (const GeoCoordinates &point)
 Expands the current rectangle so that it contains a point. More...
 

Protected Attributes

GeoCoordinates south_west_
 The southwest corner of the rectangle.
 
GeoCoordinates north_east_
 The northeast corner of the rectangle.
 

Detailed Description

A rectangular area in the WGS84 Coordinate System.

See also
GeoBox to add altitude.

Constructor & Destructor Documentation

◆ GeoRectangle()

olp::geo::GeoRectangle::GeoRectangle ( const GeoCoordinates south_west,
const GeoCoordinates north_east 
)

Creates a GeoRectangle instance.

Parameters
south_westThe southwest corner of the rectangle.
north_eastThe northeast corner of the rectangle.

Member Function Documentation

◆ BooleanUnion()

GeoRectangle olp::geo::GeoRectangle::BooleanUnion ( const GeoRectangle other) const

Unites two regtangles that have shared areas.

Parameters
otherThe other rectangle.
Returns
A new rectangle.

◆ Center()

GeoCoordinates olp::geo::GeoRectangle::Center ( ) const

Computes the center of the rectangle.

Returns
The centere of the rectangle.

◆ Contains()

bool olp::geo::GeoRectangle::Contains ( const GeoCoordinates point) const

Checks whether the coordinates contain a point.

Parameters
pointThe point to check.
Returns
True if the coordinates contain a point; false otherwise.

◆ GrowToContain()

GeoRectangle& olp::geo::GeoRectangle::GrowToContain ( const GeoCoordinates point)

Expands the current rectangle so that it contains a point.

Parameters
pointThe point to use for expanding.
Returns
The new rectangle that contains the point.

◆ IsEmpty()

bool olp::geo::GeoRectangle::IsEmpty ( ) const

Checks whether the rectangle is empty.

Returns
True if the rectangle is empty; false otherwise.

◆ LatitudeSpan()

double olp::geo::GeoRectangle::LatitudeSpan ( ) const

Gets the latitude span of the rectangle.

Returns
The latitude span.

◆ LongitudeSpan()

double olp::geo::GeoRectangle::LongitudeSpan ( ) const

Gets the longitude span of the rectangle.

Returns
The longitude span.

◆ NorthEast()

GeoCoordinates olp::geo::GeoRectangle::NorthEast ( ) const

Computes the northeast corner of the rectangle.

Returns
The northeast corner of the rectangle.

◆ NorthWest()

GeoCoordinates olp::geo::GeoRectangle::NorthWest ( ) const

Computes the northwest corner of the rectangle.

Returns
The northwest corner of the rectangle.

◆ operator!=()

bool olp::geo::GeoRectangle::operator!= ( const GeoRectangle other) const

Checks whether two rectangles are not equal.

Parameters
otherThe other rectangle.
Returns
True if the rectangles are not equal; false otherwise.

◆ operator==()

bool olp::geo::GeoRectangle::operator== ( const GeoRectangle other) const

Checks whether two rectangles are equal.

Parameters
otherThe other rectangle.
Returns
True if the rectangles are equal; false otherwise.

◆ Overlaps()

bool olp::geo::GeoRectangle::Overlaps ( const GeoRectangle rectangle) const

Checks whether two rectangles overlap.

Parameters
rectangleThe other rectangle.
Returns
True if the rectangles overlap; false otherwise.

◆ SouthEast()

GeoCoordinates olp::geo::GeoRectangle::SouthEast ( ) const

Computes the southeast corner of the rectangle.

Returns
The southeast corner of the rectangle.

◆ SouthWest()

GeoCoordinates olp::geo::GeoRectangle::SouthWest ( ) const

Computes the southwest corner of the rectangle.

Returns
The southwest corner of the rectangle.

The documentation for this class was generated from the following file: