18 #include <QCoreApplication>    97       return "nautical miles";
   213 #define DEGREE_TO_METER 111319.49079327358   214 #define FEET_TO_METER 0.3048   215 #define NMILE_TO_METER 1852.0   216 #define KILOMETERS_TO_METER 1000.0   217 #define YARDS_TO_METER 0.9144   218 #define YARDS_TO_FEET 3.0   219 #define MILES_TO_METER 1609.344   529 #define KM2_TO_M2 1000000.0   530 #define FT2_TO_M2 0.09290304   531 #define YD2_TO_M2 0.83612736   532 #define MI2_TO_M2 2589988.110336   533 #define HA_TO_M2 10000.0   534 #define AC_TO_FT2 43560.0   535 #define DEG2_TO_M2 12392029030.5   536 #define NM2_TO_M2 3429904.0   807   switch ( distanceUnit )
   922           return 400.0 / 360.0;
   945           return 60 * 180.0 / 
M_PI;
   947           return 3600 * 180.0 / 
M_PI;
   960           return 360.0 / 400.0;
   966           return 60 * 360.0 / 400.0;
   968           return 3600 * 360.0 / 400.0;
   983           return M_PI / 180.0 / 60.0;
   985           return 400.0 / 360.0 / 60.0;
   991           return 1.0 / 360.0 / 60.0;
  1004           return M_PI / 180.0 / 3600.0;
  1006           return 400.0 / 360.0 / 3600.0;
  1012           return 1.0 / 360.0 / 3600.0;
  1029           return 360.0 * 60.0;
  1031           return 360.0 * 3600.0;
  1073   return QString( 
"%L1%2" ).
arg( angle, 0, 
'f', decimals ).
arg( unitLabel );
  1090       return "Percentage";
 
static QString formatAngle(double angle, int decimals, AngleUnit unit)
Returns an angle formatted as a friendly string. 
 
OutputUnit
The unit of the output. 
 
static DistanceUnitType unitType(QGis::UnitType unit)
Returns the type for a distance unit. 
 
static AreaUnit decodeAreaUnit(const QString &string, bool *ok=0)
Decodes an areal unit from a string. 
 
static QGis::UnitType decodeDistanceUnit(const QString &string, bool *ok=0)
Decodes a distance unit from a string. 
 
The output shall be in pixels. 
 
DistanceUnitType
Types of distance units. 
 
QString trUtf8(const char *sourceText, const char *disambiguation, int n)
 
#define KILOMETERS_TO_METER
 
AngleUnit
Units of angles. 
 
static QString encodeUnit(QGis::UnitType unit)
Encodes a distance unit to a string. 
 
static QString toString(QGis::UnitType unit)
Returns a translated string representing a distance unit. 
 
The output shall be in millimeters. 
 
static QGis::UnitType stringToDistanceUnit(const QString &string, bool *ok=0)
Converts a translated string to a distance unit. 
 
The ouput shall be a percentage of another measurement (eg canvas size, feature size) ...
 
The output shall be in map unitx. 
 
static double fromUnitToUnitFactor(QGis::UnitType fromUnit, QGis::UnitType toUnit)
Returns the conversion factor between the specified distance units. 
 
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored) 
 
static AngleUnit decodeAngleUnit(const QString &string, bool *ok=0)
Decodes an angular unit from a string. 
 
static AreaUnit distanceToAreaUnit(QGis::UnitType distanceUnit)
Converts a distance unit to its corresponding area unit, eg meters to square meters. 
 
QString translate(const char *context, const char *sourceText, const char *disambiguation, Encoding encoding)
 
static AreaUnit stringToAreaUnit(const QString &string, bool *ok=0)
Converts a translated string to an areal unit. 
 
UnitType
Map units that qgis supports. 
 
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const