libosmscout 1.1.1
Loading...
Searching...
No Matches
osmscout::Projection Class Referenceabstract

#include <libosmscout/include/osmscout/projection/Projection.h>

Inheritance diagram for osmscout::Projection:

Classes

class  CLASS_FINAL

Public Member Functions

 Projection ()=default
 Projection (const Projection &)=default
 Projection (Projection &&)=default
Projectionoperator= (const Projection &)=default
Projectionoperator= (Projection &&)=default
virtual ~Projection ()=default
virtual bool CanBatch () const =0
virtual bool IsValid () const =0
virtual bool IsValidFor (const GeoCoord &coord) const =0
GeoCoord GetCenter () const
double GetAngle () const
size_t GetWidth () const
size_t GetHeight () const
ScreenBox GetScreenBox () const
Magnification GetMagnification () const
double GetDPI () const
GeoBox GetDimensions () const
double GetPixelSize () const
double GetMeterInPixel () const
double GetMeterInMM () const
double ConvertWidthToPixel (double width) const
double ConvertPixelToWidth (double pixel) const
virtual bool PixelToGeo (double x, double y, GeoCoord &coord) const =0
virtual bool GeoToPixel (const GeoCoord &coord, Vertex2D &pixel) const =0
bool BoundingBoxToPixel (const GeoBox &boundingBox, ScreenBox &screenBox) const

Protected Member Functions

virtual void GeoToPixel (const BatchTransformer &transformData) const =0

Protected Attributes

GeoCoord center
 Coordinate of the center of the displayed area.
double angle =0.0
 Display rotation angle in radians, canvas clockwise.
Magnification magnification
 Current magnification.
double dpi =0.0
 Screen DPI.
size_t width =0
 Width of image.
size_t height =0
 Height of image.
GeoBox boundingBox
 Bounding box of the current projection on the ground.
double pixelSize =0.0
 Size of a pixel in meter.
double meterInPixel =0.0
 Number of on screen pixel for one meter on the ground.
double meterInMM =0.0
 Number of on screen millimeters for one meter on the ground.

Friends

class BatchTransformer

Detailed Description

The Projection class is an abstract base class for multiple projection implementations.

The Projection class allows transformation of geo coordinates to screen/image coordinates and screen/image coordinates back to geo coordinates.

Constructor & Destructor Documentation

◆ Projection() [1/3]

osmscout::Projection::Projection ( )
default

◆ Projection() [2/3]

osmscout::Projection::Projection ( const Projection & )
default

◆ Projection() [3/3]

osmscout::Projection::Projection ( Projection && )
default

◆ ~Projection()

virtual osmscout::Projection::~Projection ( )
virtualdefault

Member Function Documentation

◆ BoundingBoxToPixel()

bool osmscout::Projection::BoundingBoxToPixel ( const GeoBox & boundingBox,
ScreenBox & screenBox ) const

Converts a valid GeoBox to its on screen pixel coordinates

Return true on success, false if given coordinate is not valid for this projection.

◆ CanBatch()

virtual bool osmscout::Projection::CanBatch ( ) const
pure virtual

◆ ConvertPixelToWidth()

double osmscout::Projection::ConvertPixelToWidth ( double pixel) const
inlinenodiscard

Convert a width in pixel into the equivalent mm size based on the given DPI

Parameters
widthWidth in screen pixel
Returns
Width in mm

◆ ConvertWidthToPixel()

double osmscout::Projection::ConvertWidthToPixel ( double width) const
inlinenodiscard

Convert a width in mm into the equivalent pixel size based on the given DPI

Parameters
widthWidth in mm
Returns
Width in screen pixel

◆ GeoToPixel() [1/2]

virtual void osmscout::Projection::GeoToPixel ( const BatchTransformer & transformData) const
protectedpure virtual

◆ GeoToPixel() [2/2]

virtual bool osmscout::Projection::GeoToPixel ( const GeoCoord & coord,
Vertex2D & pixel ) const
pure virtual

Converts a geo coordinate to a pixel coordinate.

Return true on success, false if given coordinate is not valid for this projection.

Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.

◆ GetAngle()

double osmscout::Projection::GetAngle ( ) const
inlinenodiscard

Returns the angle in radians ([0..2*PI[) of the display in relation to the north. A degree of 0 means north is to the top, a degree of PI, renders with the south to the top of the display).

◆ GetCenter()

GeoCoord osmscout::Projection::GetCenter ( ) const
inlinenodiscard

◆ GetDimensions()

GeoBox osmscout::Projection::GetDimensions ( ) const
inlinenodiscard

◆ GetDPI()

double osmscout::Projection::GetDPI ( ) const
inlinenodiscard

Return the DPI as part of the projection.

◆ GetHeight()

size_t osmscout::Projection::GetHeight ( ) const
inlinenodiscard

Returns the height of the screen

◆ GetMagnification()

Magnification osmscout::Projection::GetMagnification ( ) const
inlinenodiscard

Return the magnification as part of the projection.

◆ GetMeterInMM()

double osmscout::Projection::GetMeterInMM ( ) const
inlinenodiscard

Returns the number of on screen millimeters for one meter on the ground

◆ GetMeterInPixel()

double osmscout::Projection::GetMeterInPixel ( ) const
inlinenodiscard

Returns the number of on screen pixel for one meter on the ground

◆ GetPixelSize()

double osmscout::Projection::GetPixelSize ( ) const
inlinenodiscard

Returns the size of a pixel in meter

◆ GetScreenBox()

ScreenBox osmscout::Projection::GetScreenBox ( ) const
inlinenodiscard

Return a ScreenBox instance for the screen. The ScreenBox has the value [(0.0,0.0)(width,height)]

Returns
ScreenBox instance

◆ GetWidth()

size_t osmscout::Projection::GetWidth ( ) const
inlinenodiscard

Returns the width of the screen

◆ IsValid()

virtual bool osmscout::Projection::IsValid ( ) const
pure virtual

◆ IsValidFor()

virtual bool osmscout::Projection::IsValidFor ( const GeoCoord & coord) const
pure virtual

Return true if given coordinate is valid for this projection

Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.

◆ operator=() [1/2]

Projection & osmscout::Projection::operator= ( const Projection & )
default

◆ operator=() [2/2]

Projection & osmscout::Projection::operator= ( Projection && )
default

◆ PixelToGeo()

virtual bool osmscout::Projection::PixelToGeo ( double x,
double y,
GeoCoord & coord ) const
pure virtual

Converts a pixel coordinate to a geo coordinate.

Return true on success, false if returned coordinate is not valid for this projection.

Implemented in osmscout::MercatorProjection, and osmscout::TileProjection.

◆ BatchTransformer

friend class BatchTransformer
friend

Member Data Documentation

◆ angle

double osmscout::Projection::angle =0.0
protected

Display rotation angle in radians, canvas clockwise.

◆ boundingBox

GeoBox osmscout::Projection::boundingBox
protected

Bounding box of the current projection on the ground.

◆ center

GeoCoord osmscout::Projection::center
protected

Coordinate of the center of the displayed area.

◆ dpi

double osmscout::Projection::dpi =0.0
protected

Screen DPI.

◆ height

size_t osmscout::Projection::height =0
protected

Height of image.

◆ magnification

Magnification osmscout::Projection::magnification
protected

Current magnification.

◆ meterInMM

double osmscout::Projection::meterInMM =0.0
protected

Number of on screen millimeters for one meter on the ground.

◆ meterInPixel

double osmscout::Projection::meterInPixel =0.0
protected

Number of on screen pixel for one meter on the ground.

◆ pixelSize

double osmscout::Projection::pixelSize =0.0
protected

Size of a pixel in meter.

◆ width

size_t osmscout::Projection::width =0
protected

Width of image.


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