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


Public Member Functions | |
| MercatorProjection () | |
| bool | CanBatch () const override |
| bool | IsValid () const override |
| bool | IsValidFor (const GeoCoord &coord) const override |
| bool | Set (const GeoCoord &coord, const Magnification &magnification, size_t width, size_t height) |
| bool | Set (const GeoCoord &coord, double angle, const Magnification &magnification, size_t width, size_t height) |
| bool | Set (const GeoCoord &coord, const Magnification &magnification, double dpi, size_t width, size_t height) |
| bool | Set (const GeoCoord &coord, double angle, const Magnification &magnification, double dpi, size_t width, size_t height) |
| bool | PixelToGeo (double x, double y, double &lon, double &lat) const override |
| bool | PixelToGeo (double x, double y, GeoCoord &coord) const |
| bool | GeoToPixel (const GeoCoord &coord, double &x, double &y) const override |
| bool | Move (double horizPixel, double vertPixel) |
| bool | MoveUp (double pixel) |
| bool | MoveDown (double pixel) |
| bool | MoveLeft (double pixel) |
| bool | MoveRight (double pixel) |
| bool | IsLinearInterpolationEnabled () const |
| void | SetLinearInterpolationUsage (bool useLinearInterpolation) |
Public Member Functions inherited from osmscout::Projection | |
| Projection () | |
| virtual | ~Projection ()=default |
| 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 |
Static Public Attributes | |
| static const double | MaxLat |
| static const double | MinLat |
| static const double | MaxLon |
| static const double | MinLon |
Protected Member Functions | |
| void | GeoToPixel (const BatchTransformer &transformData) const override |
Protected Attributes | |
| bool | valid |
| projection is valid More... | |
| double | latOffset |
| Absolute and untransformed screen position of lat coordinate. More... | |
| double | angleSin |
| double | angleCos |
| double | angleNegSin |
| double | angleNegCos |
| double | scale |
| double | scaleGradtorad |
| Precalculated scale*Gradtorad. More... | |
| double | scaledLatDeriv |
| precalculated derivation of "latToYPixel" function in projection center scaled by gradtorad * scale More... | |
| bool | useLinearInterpolation |
| switch to enable linear interpolation of latitude to pixel computation More... | |
Protected Attributes inherited from osmscout::Projection | |
| 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... | |
Mercator projection that tries to render the resulting map in the same physical size on all devices. If the physical DPI of the device is correctly given, objects on any device has the same size. Bigger devices will show "more" map thus.
Scale is calculated based on the assumption that the original OpenStreetMap tiles were designed for 96 DPI displays.
| osmscout::MercatorProjection::MercatorProjection | ( | ) |
|
inlineoverridevirtual |
Implements osmscout::Projection.
|
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.
|
overrideprotectedvirtual |
Implements osmscout::Projection.
|
inline |
|
inlineoverridevirtual |
Implements osmscout::Projection.
|
inlineoverridevirtual |
Return true if given coordinate is valid for this projection
Implements osmscout::Projection.
| bool osmscout::MercatorProjection::Move | ( | double | horizPixel, |
| double | vertPixel | ||
| ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
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.
|
inline |
|
inline |
|
inline |
|
inline |
| bool osmscout::MercatorProjection::Set | ( | const GeoCoord & | coord, |
| double | angle, | ||
| const Magnification & | magnification, | ||
| double | dpi, | ||
| size_t | width, | ||
| size_t | height | ||
| ) |
Setup projection parameters.
Return true on success, false if arguments are not valid for Mercator projection, projection parameters are unchanged in such case.
Angle is in radians ([0..2*PI[)
Note that coord (center) have to be valid coordinate in Mercator projection. But it is possible setup dimensions (width and height) that projection will cover area bigger than the one valid for Mercator projection. Bounding box is adjusted then to be valid for projection.
In code:
projection.GetDimensions(bbox); projection.GeoToPixel(bbox.GetMinCoord(),x,y)
may be x >= 0
|
inline |
Switch to enable/disable linear interpolation of latitude to pixel computation. It speedup GeoToPixel calculation with fractional error on small render area.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Absolute and untransformed screen position of lat coordinate.
|
static |
|
static |
|
static |
|
static |
|
protected |
|
protected |
precalculated derivation of "latToYPixel" function in projection center scaled by gradtorad * scale
|
protected |
Precalculated scale*Gradtorad.
|
protected |
switch to enable linear interpolation of latitude to pixel computation
|
protected |
projection is valid
1.8.14