QGIS/python/core/qgsscalecalculator.sip

85 lines
2.7 KiB
Plaintext
Raw Normal View History

2017-05-18 16:39:21 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsscalecalculator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsScaleCalculator
{
2017-05-18 16:39:21 +02:00
%Docstring
Calculates scale for a given combination of canvas size, map extent,
and monitor dpi.
%End
%TypeHeaderCode
2017-05-18 16:39:21 +02:00
#include "qgsscalecalculator.h"
%End
public:
QgsScaleCalculator( double dpi = 0,
QgsUnitTypes::DistanceUnit mapUnits = QgsUnitTypes::DistanceMeters );
2017-05-18 16:39:21 +02:00
%Docstring
Constructor
\param dpi Monitor resolution in dots per inch
\param mapUnits Units of the data on the map
%End
void setDpi( double dpi );
2017-05-18 16:39:21 +02:00
%Docstring
Set the dpi to be used in scale calculations
\param dpi Dots per inch of monitor resolution
%End
double dpi();
2017-05-18 16:39:21 +02:00
%Docstring
Accessor for dpi used in scale calculations
:return: int the dpi used for scale calculations.
:rtype: float
%End
void setMapUnits( QgsUnitTypes::DistanceUnit mapUnits );
2017-05-18 16:39:21 +02:00
%Docstring
Set the map units
\param mapUnits Units of the data on the map. Must match a value from the
%End
QgsUnitTypes::DistanceUnit mapUnits() const;
2017-05-18 16:39:21 +02:00
%Docstring
Returns current map units
:rtype: QgsUnitTypes.DistanceUnit
%End
double calculate( const QgsRectangle &mapExtent, int canvasWidth );
2017-05-18 16:39:21 +02:00
%Docstring
Calculate the scale denominator
\param mapExtent QgsRectangle containing the current map extent
\param canvasWidth Width of the map canvas in pixel (physical) units
:return: scale denominator of current map view
:rtype: float
%End
double calculateGeographicDistance( const QgsRectangle &mapExtent );
2017-05-18 16:39:21 +02:00
%Docstring
Calculate the distance between two points in geographic coordinates.
Used to calculate scale for map views with geographic (decimal degree)
data.
\param mapExtent QgsRectangle containing the current map extent
:rtype: float
%End
};
2017-05-18 16:39:21 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsscalecalculator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/