QGIS API Documentation
3.10.0-A Coruña (6c816b4204)
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Related Functions
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
u
v
w
z
+
Variables
a
b
c
d
e
g
h
i
l
n
o
p
q
r
s
t
u
w
+
Typedefs
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
+
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
qgsscalecalculator.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsscalecalculator.h
3
Calculates scale based on map extent and units
4
-------------------
5
begin : May 18, 2004
6
copyright : (C) 2004 by Gary E.Sherman
7
email : sherman at mrcc.com
8
***************************************************************************/
9
10
/***************************************************************************
11
* *
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
16
* *
17
***************************************************************************/
18
19
#ifndef QGSSCALECALCULATOR_H
20
#define QGSSCALECALCULATOR_H
21
22
#include "qgis_core.h"
23
#include "
qgis_sip.h
"
24
#include "
qgsunittypes.h
"
25
26
class
QString;
27
class
QgsRectangle
;
28
34
class
CORE_EXPORT
QgsScaleCalculator
35
{
36
public
:
37
43
QgsScaleCalculator
(
double
dpi = 0,
44
QgsUnitTypes::DistanceUnit
mapUnits =
QgsUnitTypes::DistanceMeters
);
45
50
void
setDpi(
double
dpi );
51
56
double
dpi();
57
62
void
setMapUnits(
QgsUnitTypes::DistanceUnit
mapUnits );
63
65
QgsUnitTypes::DistanceUnit
mapUnits()
const
;
66
73
double
calculate(
const
QgsRectangle
&mapExtent,
double
canvasWidth )
const
;
74
81
double
calculateGeographicDistance(
const
QgsRectangle
&mapExtent )
const
;
82
83
private
:
84
86
double
mDpi;
87
89
QgsUnitTypes::DistanceUnit
mMapUnits;
90
};
91
92
#endif // #ifndef QGSSCALECALCULATOR_H
QgsRectangle
A rectangle specified with double values.
Definition:
qgsrectangle.h:41
qgsunittypes.h
qgis_sip.h
QgsScaleCalculator
Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
Definition:
qgsscalecalculator.h:34
QgsUnitTypes::DistanceUnit
DistanceUnit
Units of distance.
Definition:
qgsunittypes.h:66
QgsUnitTypes::DistanceMeters
Meters.
Definition:
qgsunittypes.h:68
Generated on Sun Oct 27 2019 00:43:28 for QGIS API Documentation by
1.8.13