libosmscout  1.1.1
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
osmscout::Projection Class Referenceabstract

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

Inheritance diagram for osmscout::Projection:
Inheritance graph
[legend]

Classes

class  BatchTransformer
 

Public Member Functions

 Projection ()
 
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 GetLon () const
 
double GetLat () const
 
double GetAngle () const
 
size_t GetWidth () const
 
size_t GetHeight () const
 
Magnification GetMagnification () const
 
double GetDPI () const
 
bool GeoIsIn (double lon, double lat) const
 
bool GeoIsIn (double lonMin, double latMin, double lonMax, double latMax) const
 
GeoBox GetDimensions () const
 
void GetDimensions (GeoBox &boundingBox) 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, double &lon, double &lat) const =0
 
virtual bool GeoToPixel (const GeoCoord &coord, double &x, double &y) const =0
 

Protected Member Functions

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

Protected Attributes

double lon
 Longitude coordinate of the center of the image. More...
 
double lat
 Latitude coordinate of the center of the image. More...
 
double angle
 Display rotation angle in radians, canvas clockwise. More...
 
Magnification magnification
 Current magnification. More...
 
double dpi
 Screen DPI. More...
 
size_t width
 Width of image. More...
 
size_t height
 Height of image. More...
 
double lonMin
 Longitude of the upper left corner of the image. More...
 
double latMin
 Latitude of the upper left corner of the image. More...
 
double lonMax
 Longitude of the lower right corner of the image. More...
 
double latMax
 Latitude of the lower right corner of the image. More...
 
double pixelSize
 Size of a pixel in meter. More...
 
double meterInPixel
 Number of on screen pixel for one meter on the ground. More...
 
double meterInMM
 Number of on screen millimeters for one meter on the ground. More...
 

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()

osmscout::Projection::Projection ( )

◆ ~Projection()

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

Member Function Documentation

◆ CanBatch()

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

◆ ConvertPixelToWidth()

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

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
inline

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

Parameters
widthWidth in mm
Returns
Width in screen pixel

◆ GeoIsIn() [1/2]

bool osmscout::Projection::GeoIsIn ( double  lon,
double  lat 
) const
inline

Returns true, if the given geo coordinate is in the bounding box

◆ GeoIsIn() [2/2]

bool osmscout::Projection::GeoIsIn ( double  lonMin,
double  latMin,
double  lonMax,
double  latMax 
) const
inline

Returns true, if the given bounding box is completely within the projection bounding box

◆ GeoToPixel() [1/2]

virtual bool osmscout::Projection::GeoToPixel ( const GeoCoord &  coord,
double &  x,
double &  y 
) 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::TileProjection, and osmscout::MercatorProjection.

◆ GeoToPixel() [2/2]

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

◆ GetAngle()

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

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
inline

◆ GetDimensions() [1/2]

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

◆ GetDimensions() [2/2]

void osmscout::Projection::GetDimensions ( GeoBox &  boundingBox) const
inline

Returns the bounding box of the area covered

◆ GetDPI()

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

Return the DPI as part of the projection.

◆ GetHeight()

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

Returns the height of the screen

◆ GetLat()

double osmscout::Projection::GetLat ( ) const
inline

Returns latitude coordinate of the region center.

◆ GetLon()

double osmscout::Projection::GetLon ( ) const
inline

Returns longitude coordinate of the region center.

◆ GetMagnification()

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

Return the magnification as part of the projection.

◆ GetMeterInMM()

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

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

◆ GetMeterInPixel()

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

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

◆ GetPixelSize()

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

Returns the size of a pixel in meter

◆ GetWidth()

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

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::TileProjection, and osmscout::MercatorProjection.

◆ PixelToGeo()

virtual bool osmscout::Projection::PixelToGeo ( double  x,
double  y,
double &  lon,
double &  lat 
) 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::TileProjection, and osmscout::MercatorProjection.

Friends And Related Function Documentation

◆ BatchTransformer

friend class BatchTransformer
friend

Member Data Documentation

◆ angle

double osmscout::Projection::angle
protected

Display rotation angle in radians, canvas clockwise.

◆ dpi

double osmscout::Projection::dpi
protected

Screen DPI.

◆ height

size_t osmscout::Projection::height
protected

Height of image.

◆ lat

double osmscout::Projection::lat
protected

Latitude coordinate of the center of the image.

◆ latMax

double osmscout::Projection::latMax
protected

Latitude of the lower right corner of the image.

◆ latMin

double osmscout::Projection::latMin
protected

Latitude of the upper left corner of the image.

◆ lon

double osmscout::Projection::lon
protected

Longitude coordinate of the center of the image.

◆ lonMax

double osmscout::Projection::lonMax
protected

Longitude of the lower right corner of the image.

◆ lonMin

double osmscout::Projection::lonMin
protected

Longitude of the upper left corner of the image.

◆ magnification

Magnification osmscout::Projection::magnification
protected

Current magnification.

◆ meterInMM

double osmscout::Projection::meterInMM
protected

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

◆ meterInPixel

double osmscout::Projection::meterInPixel
protected

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

◆ pixelSize

double osmscout::Projection::pixelSize
protected

Size of a pixel in meter.

◆ width

size_t osmscout::Projection::width
protected

Width of image.


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