libosmscout 1.1.1
Loading...
Searching...
No Matches
osmscout::TileProjection Class Reference

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

Inheritance diagram for osmscout::TileProjection:
Collaboration diagram for osmscout::TileProjection:

Public Member Functions

 TileProjection ()=default
 TileProjection (const TileProjection &)=default
 TileProjection (TileProjection &&)=default
TileProjectionoperator= (const TileProjection &)=default
TileProjectionoperator= (TileProjection &&)=default
 ~TileProjection () override=default
bool CanBatch () const override
bool IsValid () const override
bool IsValidFor (const GeoCoord &coord) const override
bool Set (const OSMTileId &tile, const Magnification &magnification, size_t width, size_t height)
bool Set (const OSMTileId &tile, const Magnification &magnification, double dpi, size_t width, size_t height)
bool Set (const OSMTileIdBox &tileBox, const Magnification &magnification, double dpi, size_t width, size_t height)
bool PixelToGeo (double x, double y, GeoCoord &coord) const override
bool GeoToPixel (const GeoCoord &coord, Vertex2D &pixel) const override
bool IsLinearInterpolationEnabled () const
void SetLinearInterpolationUsage (bool b)
Public Member Functions inherited from osmscout::Projection
 Projection ()=default
 Projection (const Projection &)=default
 Projection (Projection &&)=default
Projectionoperator= (const Projection &)=default
Projectionoperator= (Projection &&)=default
virtual ~Projection ()=default
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
bool BoundingBoxToPixel (const GeoBox &boundingBox, ScreenBox &screenBox) const

Protected Member Functions

virtual bool SetInternal (const GeoBox &boundingBox, const Magnification &magnification, double dpi, size_t width, size_t height)
void GeoToPixel (const BatchTransformer &transformData) const override

Additional Inherited Members

Protected Attributes inherited from osmscout::Projection
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.

Detailed Description

Mercator projection as used by the OpenStreetMap tile rendering code.

The TileProjection simplifies the general Mercator projection code to make sure that there are no effects based on rounding errors or similar.

Constructor & Destructor Documentation

◆ TileProjection() [1/3]

osmscout::TileProjection::TileProjection ( )
default

◆ TileProjection() [2/3]

osmscout::TileProjection::TileProjection ( const TileProjection & )
default

◆ TileProjection() [3/3]

osmscout::TileProjection::TileProjection ( TileProjection && )
default

◆ ~TileProjection()

osmscout::TileProjection::~TileProjection ( )
overridedefault

Member Function Documentation

◆ CanBatch()

bool osmscout::TileProjection::CanBatch ( ) const
inlineoverridevirtual

Implements osmscout::Projection.

◆ GeoToPixel() [1/2]

void osmscout::TileProjection::GeoToPixel ( const BatchTransformer & transformData) const
overrideprotectedvirtual

Implements osmscout::Projection.

◆ GeoToPixel() [2/2]

bool osmscout::TileProjection::GeoToPixel ( const GeoCoord & coord,
Vertex2D & pixel ) const
overridevirtual

Converts a geo coordinate to a pixel coordinate.

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

Implements osmscout::Projection.

◆ IsLinearInterpolationEnabled()

bool osmscout::TileProjection::IsLinearInterpolationEnabled ( ) const
inlinenodiscard

◆ IsValid()

bool osmscout::TileProjection::IsValid ( ) const
inlineoverridevirtual

Implements osmscout::Projection.

◆ IsValidFor()

bool osmscout::TileProjection::IsValidFor ( const GeoCoord & coord) const
inlineoverridevirtual

Return true if given coordinate is valid for this projection

Implements osmscout::Projection.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ PixelToGeo()

bool osmscout::TileProjection::PixelToGeo ( double x,
double y,
GeoCoord & coord ) const
overridevirtual

Converts a pixel coordinate to a geo coordinate.

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

Implements osmscout::Projection.

◆ Set() [1/3]

bool osmscout::TileProjection::Set ( const OSMTileId & tile,
const Magnification & magnification,
double dpi,
size_t width,
size_t height )

◆ Set() [2/3]

bool osmscout::TileProjection::Set ( const OSMTileId & tile,
const Magnification & magnification,
size_t width,
size_t height )
inline

◆ Set() [3/3]

bool osmscout::TileProjection::Set ( const OSMTileIdBox & tileBox,
const Magnification & magnification,
double dpi,
size_t width,
size_t height )

◆ SetInternal()

virtual bool osmscout::TileProjection::SetInternal ( const GeoBox & boundingBox,
const Magnification & magnification,
double dpi,
size_t width,
size_t height )
protectedvirtual

◆ SetLinearInterpolationUsage()

void osmscout::TileProjection::SetLinearInterpolationUsage ( bool b)
inline

Switch to enable/disable linear interpolation of latitude to pixel computation. It speedup GeoToPixel calculation with fractional error on small render area.


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