31 return QStringLiteral(
"distance" );
34 return QStringLiteral(
"area" );
37 return QStringLiteral(
"volume" );
40 return QStringLiteral(
"temporal" );
43 return QStringLiteral(
"<unknown>" );
51 const QString normalized =
string.trimmed().toLower();
168 return QStringLiteral(
"meters" );
171 return QStringLiteral(
"km" );
174 return QStringLiteral(
"feet" );
177 return QStringLiteral(
"yd" );
180 return QStringLiteral(
"mi" );
183 return QStringLiteral(
"degrees" );
186 return QStringLiteral(
"<unknown>" );
189 return QStringLiteral(
"nautical miles" );
192 return QStringLiteral(
"cm" );
195 return QStringLiteral(
"mm" );
198 return QStringLiteral(
"in" );
201 return QStringLiteral(
"chain" );
204 return QStringLiteral(
"chain british benoit b1895a" );
207 return QStringLiteral(
"chain british benoit b1895b" );
210 return QStringLiteral(
"chain british sears 1922 truncated" );
213 return QStringLiteral(
"chain british sears 1922" );
216 return QStringLiteral(
"chain clarkes" );
219 return QStringLiteral(
"chain us survey" );
222 return QStringLiteral(
"feet british 1865" );
225 return QStringLiteral(
"feet british 1936" );
228 return QStringLiteral(
"feet british benoit 1895a" );
231 return QStringLiteral(
"feet british benoit 1895b" );
234 return QStringLiteral(
"feet british sears 1922 truncated" );
237 return QStringLiteral(
"feet british sears 1922" );
240 return QStringLiteral(
"feet clarkes" );
243 return QStringLiteral(
"feet gold coast" );
246 return QStringLiteral(
"feet indian" );
248 return QStringLiteral(
"feet indian 1937" );
251 return QStringLiteral(
"feet indian 1962" );
254 return QStringLiteral(
"feet indian 1975" );
257 return QStringLiteral(
"feet us survey" );
260 return QStringLiteral(
"links" );
263 return QStringLiteral(
"links british benoit 1895a" );
266 return QStringLiteral(
"links british benoit 1895b" );
269 return QStringLiteral(
"links british sears 1922 truncated" );
272 return QStringLiteral(
"links british sears 1922" );
275 return QStringLiteral(
"links clarkes" );
278 return QStringLiteral(
"links us survey" );
281 return QStringLiteral(
"yards british benoit 1895a" );
284 return QStringLiteral(
"yards british benoit 1895b" );
287 return QStringLiteral(
"yards british sears 1922 truncated" );
290 return QStringLiteral(
"yards british sears 1922" );
293 return QStringLiteral(
"yards clarkes" );
296 return QStringLiteral(
"yards indian" );
299 return QStringLiteral(
"yards indian 1937" );
302 return QStringLiteral(
"yards indian 1962" );
305 return QStringLiteral(
"yards indian 1975" );
308 return QStringLiteral(
"miles us survey" );
311 return QStringLiteral(
"yards fathom" );
314 return QStringLiteral(
"german legal meters" );
327 const QString normalized =
string.trimmed().toLower();
401 return QObject::tr(
"meters",
"distance" );
404 return QObject::tr(
"kilometers",
"distance" );
407 return QObject::tr(
"feet",
"distance" );
410 return QObject::tr(
"yards",
"distance" );
413 return QObject::tr(
"miles",
"distance" );
416 return QObject::tr(
"degrees",
"distance" );
419 return QObject::tr(
"centimeters",
"distance" );
422 return QObject::tr(
"millimeters",
"distance" );
425 return QObject::tr(
"inches",
"distance" );
428 return QObject::tr(
"<unknown>",
"distance" );
431 return QObject::tr(
"nautical miles",
"distance" );
434 return QObject::tr(
"chains (international)",
"distance" );
437 return QObject::tr(
"chains (British, Benoit 1895 A)",
"distance" );
440 return QObject::tr(
"chains (British, Benoit 1895 B)",
"distance" );
443 return QObject::tr(
"chains (British, Sears 1922 truncated)",
"distance" );
446 return QObject::tr(
"chains (British, Sears 1922)",
"distance" );
449 return QObject::tr(
"chains (Clarke's)",
"distance" );
452 return QObject::tr(
"chains (US survey)",
"distance" );
455 return QObject::tr(
"feet (British, 1865)",
"distance" );
458 return QObject::tr(
"feet (British, 1936)",
"distance" );
461 return QObject::tr(
"feet (British, Benoit 1895 A)",
"distance" );
464 return QObject::tr(
"feet (British, Benoit 1895 B)",
"distance" );
467 return QObject::tr(
"feet (British, Sears 1922 truncated)",
"distance" );
470 return QObject::tr(
"feet (British, Sears 1922)",
"distance" );
473 return QObject::tr(
"feet (Clarke's)",
"distance" );
476 return QObject::tr(
"feet (Gold Coast)",
"distance" );
479 return QObject::tr(
"feet (Indian)",
"distance" );
482 return QObject::tr(
"feet (Indian 1937)",
"distance" );
485 return QObject::tr(
"feet (Indian 1962)",
"distance" );
488 return QObject::tr(
"feet (Indian 1975)",
"distance" );
491 return QObject::tr(
"feet (US survey)",
"distance" );
494 return QObject::tr(
"links",
"distance" );
497 return QObject::tr(
"links (British, Benoit 1895 A)",
"distance" );
500 return QObject::tr(
"links (British, Benoit 1895 B)",
"distance" );
503 return QObject::tr(
"links (British, Sears 1922 truncated)",
"distance" );
506 return QObject::tr(
"links (British, Sears 1922)",
"distance" );
509 return QObject::tr(
"links (Clarke's)",
"distance" );
512 return QObject::tr(
"links (US survey)",
"distance" );
515 return QObject::tr(
"yards (British, Benoit 1895 A)",
"distance" );
518 return QObject::tr(
"yards (British, Benoit 1895 B)",
"distance" );
521 return QObject::tr(
"yards (British, Sears 1922 truncated)",
"distance" );
524 return QObject::tr(
"yards (British, Sears 1922)",
"distance" );
527 return QObject::tr(
"yards (Clarke's)",
"distance" );
530 return QObject::tr(
"yards (Indian)",
"distance" );
533 return QObject::tr(
"yards (Indian 1937)",
"distance" );
536 return QObject::tr(
"yards (Indian 1962)",
"distance" );
539 return QObject::tr(
"yards (Indian 1975)",
"distance" );
542 return QObject::tr(
"miles (US survey)",
"distance" );
545 return QObject::tr(
"fathoms",
"distance" );
548 return QObject::tr(
"meters (German legal)",
"distance" );
558 return QObject::tr(
"mm",
"render" );
561 return QObject::tr(
"map units",
"render" );
564 return QObject::tr(
"px",
"render" );
567 return QObject::tr(
"%",
"render" );
570 return QObject::tr(
"pt",
"render" );
573 return QObject::tr(
"in",
"render" );
576 return QObject::tr(
"unknown",
"render" );
579 return QObject::tr(
"m",
"render" );
591 return QObject::tr(
"m",
"distance" );
594 return QObject::tr(
"km",
"distance" );
610 return QObject::tr(
"ft",
"distance" );
622 return QObject::tr(
"yd",
"distance" );
626 return QObject::tr(
"mi",
"distance" );
629 return QObject::tr(
"deg",
"distance" );
632 return QObject::tr(
"cm",
"distance" );
635 return QObject::tr(
"mm",
"distance" );
638 return QObject::tr(
"in",
"distance" );
644 return QObject::tr(
"NM",
"distance" );
653 return QObject::tr(
"ch",
"distance" );
662 return QObject::tr(
"lk",
"distance" );
665 return QObject::tr(
"f",
"distance" );
668 return QObject::tr(
"glm",
"distance" );
682 const QString normalized =
string.trimmed().toLower();
741 if ( normalized.compare(
toString( unit ), Qt::CaseInsensitive ) == 0 )
775 return 111319.49079327358;
787 return 20.116782494376;
791 return 20.116765121553;
793 return 20.1166195164;
795 return 20.11684023368;
797 return 0.30480083333333;
801 return 0.30479973333333;
803 return 0.30479973476327;
805 return 0.30479933333333;
807 return 0.30479947153868;
811 return 0.30479971018151;
813 return 0.30479951024815;
821 return 0.30480060960122;
827 return 0.20116782494376;
831 return 0.20116765121553;
833 return 0.201166195164;
835 return 0.2011684023368;
839 return 0.91439920428981;
843 return 0.91439841461603;
847 return 0.91439853074444;
855 return 1609.3472186944;
871 constexpr double FEET_TO_INCHES = 12;
872 constexpr double YARDS_TO_FEET = 3.0;
884 return FEET_TO_INCHES;
886 return 1.0 / YARDS_TO_FEET;
898 return YARDS_TO_FEET;
900 return YARDS_TO_FEET * FEET_TO_INCHES;
913 return 1.0 / FEET_TO_INCHES;
915 return 1.0 / ( YARDS_TO_FEET * FEET_TO_INCHES );
935 return QStringLiteral(
"m2" );
937 return QStringLiteral(
"km2" );
939 return QStringLiteral(
"ft2" );
941 return QStringLiteral(
"y2" );
943 return QStringLiteral(
"mi2" );
945 return QStringLiteral(
"ha" );
947 return QStringLiteral(
"ac" );
949 return QStringLiteral(
"nm2" );
951 return QStringLiteral(
"deg2" );
953 return QStringLiteral(
"cm2" );
955 return QStringLiteral(
"mm2" );
957 return QStringLiteral(
"in2" );
959 return QStringLiteral(
"<unknown>" );
966 const QString normalized =
string.trimmed().toLower();
1009 return QObject::tr(
"square meters",
"area" );
1011 return QObject::tr(
"square kilometers",
"area" );
1013 return QObject::tr(
"square feet",
"area" );
1015 return QObject::tr(
"square yards",
"area" );
1017 return QObject::tr(
"square miles",
"area" );
1019 return QObject::tr(
"hectares",
"area" );
1021 return QObject::tr(
"acres",
"area" );
1023 return QObject::tr(
"square nautical miles",
"area" );
1025 return QObject::tr(
"square degrees",
"area" );
1027 return QObject::tr(
"square millimeters",
"area" );
1029 return QObject::tr(
"square centimeters",
"area" );
1031 return QObject::tr(
"square inches",
"area" );
1033 return QObject::tr(
"<unknown>",
"area" );
1043 return QObject::tr(
"m²",
"area" );
1045 return QObject::tr(
"km²",
"area" );
1047 return QObject::tr(
"ft²",
"area" );
1049 return QObject::tr(
"yd²",
"area" );
1051 return QObject::tr(
"mi²",
"area" );
1053 return QObject::tr(
"ha",
"area" );
1055 return QObject::tr(
"ac",
"area" );
1057 return QObject::tr(
"NM²",
"area" );
1059 return QObject::tr(
"deg²",
"area" );
1061 return QObject::tr(
"cm²",
"area" );
1063 return QObject::tr(
"mm²",
"area" );
1065 return QObject::tr(
"in²",
"area" );
1074 const QString normalized =
string.trimmed().toLower();
1113#define KM2_TO_M2 1000000.0
1114#define CM2_TO_M2 0.0001
1115#define MM2_TO_M2 0.000001
1116#define FT2_TO_M2 0.09290304
1117#define IN2_TO_M2 0.00064516
1118#define YD2_TO_M2 0.83612736
1119#define MI2_TO_M2 2589988.110336
1120#define HA_TO_M2 10000.0
1121#define AC_TO_FT2 43560.0
1122#define DEG2_TO_M2 12392029030.5
1123#define NM2_TO_M2 3429904.0
1550 switch ( distanceUnit )
1676 return QStringLiteral(
"s" );
1678 return QStringLiteral(
"ms" );
1680 return QStringLiteral(
"min" );
1682 return QStringLiteral(
"h" );
1684 return QStringLiteral(
"d" );
1686 return QStringLiteral(
"wk" );
1688 return QStringLiteral(
"mon" );
1690 return QStringLiteral(
"y" );
1692 return QStringLiteral(
"dec" );
1694 return QStringLiteral(
"c" );
1696 return QStringLiteral(
"xxx" );
1698 return QStringLiteral(
"<unknown>" );
1705 const QString normalized =
string.trimmed().toLower();
1746 return QObject::tr(
"seconds",
"temporal" );
1748 return QObject::tr(
"milliseconds",
"temporal" );
1750 return QObject::tr(
"minutes",
"temporal" );
1752 return QObject::tr(
"hours",
"temporal" );
1754 return QObject::tr(
"days",
"temporal" );
1756 return QObject::tr(
"weeks",
"temporal" );
1758 return QObject::tr(
"months",
"temporal" );
1760 return QObject::tr(
"years",
"temporal" );
1762 return QObject::tr(
"decades",
"temporal" );
1764 return QObject::tr(
"centuries",
"temporal" );
1766 return QObject::tr(
"steps",
"temporal" );
1768 return QObject::tr(
"<unknown>",
"temporal" );
1778 return QObject::tr(
"s",
"temporal" );
1780 return QObject::tr(
"ms",
"temporal" );
1782 return QObject::tr(
"min",
"temporal" );
1784 return QObject::tr(
"h",
"temporal" );
1786 return QObject::tr(
"d",
"temporal" );
1788 return QObject::tr(
"wk",
"temporal" );
1790 return QObject::tr(
"mon",
"temporal" );
1792 return QObject::tr(
"y",
"temporal" );
1794 return QObject::tr(
"dec",
"temporal" );
1796 return QObject::tr(
"cen",
"temporal" );
1798 return QObject::tr(
"steps",
"temporal" );
1800 return QObject::tr(
"<unknown>",
"temporal" );
1807 const QString normalized =
string.trimmed().toLower();
1862 return 1 / 604800.0;
1864 return 1 / 2592000.0;
1866 return 1 / 31557600.0;
1868 return 1 / 315576000.0;
1870 return 1 / 3155760000.0;
1888 return 1 / 3600000.0;
1890 return 1 / 86400000.0;
1892 return 1 / 604800000.0;
1894 return 1 / 2592000000.0;
1896 return 1 / 31557600000.0;
1898 return 1 / 315576000000.0;
1900 return 1 / 3155760000000.0;
1926 return 1 / 525960.0;
1928 return 1 / 5259600.0;
1930 return 1 / 52596000.0;
1960 return 1 / 876600.0;
2034 return 2592000000.0;
2050 return 30 / 36525.0;
2064 return 31557600000.0;
2072 return 365.25 / 7.0;
2074 return 365.25 / 30.0;
2094 return 315576000000.0;
2102 return 3652.5 / 7.0;
2104 return 3652.5 / 30.0;
2123 return 3155760000.0;
2125 return 3155760000000.0;
2135 return 36525 / 30.0;
2160 const QString normalized =
string.trimmed().toLower();
2199 return QObject::tr(
"cubic meters",
"volume" );
2201 return QObject::tr(
"cubic feet",
"volume" );
2203 return QObject::tr(
"cubic yards",
"volume" );
2205 return QObject::tr(
"barrels",
"volume" );
2207 return QObject::tr(
"cubic decimeters",
"volume" );
2209 return QObject::tr(
"liters",
"volume" );
2211 return QObject::tr(
"gallons",
"volume" );
2213 return QObject::tr(
"cubic inches",
"volume" );
2215 return QObject::tr(
"cubic centimeters",
"volume" );
2217 return QObject::tr(
"cubic degrees",
"volume" );
2219 return QObject::tr(
"<unknown>",
"volume" );
2229 return QObject::tr(
"m³",
"volume" );
2231 return QObject::tr(
"ft³",
"volume" );
2233 return QObject::tr(
"yds³",
"volume" );
2235 return QObject::tr(
"bbl",
"volume" );
2237 return QObject::tr(
"dm³",
"volume" );
2239 return QObject::tr(
"l",
"volume" );
2241 return QObject::tr(
"gal",
"volume" );
2243 return QObject::tr(
"in³",
"volume" );
2245 return QObject::tr(
"cm³",
"volume" );
2247 return QObject::tr(
"deg³",
"volume" );
2249 return QObject::tr(
"<unknown>",
"volume" );
2257 const QString normalized =
string.trimmed().toLower();
2291#define DEG2_TO_M3 1379474361572186.2
2305 return 35.314666572222;
2307 return 1.307950613786;
2309 return 6.2898107438466;
2315 return 264.17205124156;
2317 return 61023.7438368;
2332 return 0.028316846592;
2346 return 1728.000629765;
2363 return 26.999998234;
2373 return 201.974025549;
2375 return 46656.013952472;
2402 return 41.999998943;
2404 return 9702.002677722;
2433 return 61.023758990;
2461 return 231.000069567;
2491 return 16.387060000;
2515 return 0.000264172 ;
2546 switch ( distanceUnit )
2627 switch ( volumeUnit )
2682 return QStringLiteral(
"m3" );
2684 return QStringLiteral(
"ft3" );
2686 return QStringLiteral(
"yd3" );
2688 return QStringLiteral(
"bbl" );
2690 return QStringLiteral(
"dm3" );
2692 return QStringLiteral(
"l" );
2694 return QStringLiteral(
"gal" );
2696 return QStringLiteral(
"in3" );
2698 return QStringLiteral(
"cm3" );
2700 return QStringLiteral(
"deg3" );
2702 return QStringLiteral(
"<unknown>" );
2712 return QStringLiteral(
"degrees" );
2714 return QStringLiteral(
"radians" );
2716 return QStringLiteral(
"gon" );
2718 return QStringLiteral(
"moa" );
2720 return QStringLiteral(
"soa" );
2722 return QStringLiteral(
"tr" );
2724 return QStringLiteral(
"milliradians" );
2726 return QStringLiteral(
"mil" );
2728 return QStringLiteral(
"<unknown>" );
2735 const QString normalized =
string.trimmed().toLower();
2769 return QObject::tr(
"degrees",
"angle" );
2771 return QObject::tr(
"radians",
"angle" );
2773 return QObject::tr(
"gon",
"angle" );
2775 return QObject::tr(
"minutes of arc",
"angle" );
2777 return QObject::tr(
"seconds of arc",
"angle" );
2779 return QObject::tr(
"turns",
"angle" );
2781 return QObject::tr(
"milliradians",
"angle" );
2783 return QObject::tr(
"mil",
"angle" );
2785 return QObject::tr(
"<unknown>",
"angle" );
2802 return M_PI / 180.0;
2804 return 400.0 / 360.0;
2812 return M_PI / 180.0 * 1000;
2814 return 3200.0 / 180;
2825 return 180.0 / M_PI;
2829 return 200.0 / M_PI;
2831 return 60 * 180.0 / M_PI;
2833 return 3600 * 180.0 / M_PI;
2839 return 3200.0 / M_PI;
2850 return 360.0 / 400.0;
2852 return M_PI / 200.0;
2856 return 60 * 360.0 / 400.0;
2858 return 3600 * 360.0 / 400.0;
2862 return M_PI / 200.0 * 1000;
2864 return 3200.0 / 200.0;
2877 return M_PI / 180.0 / 60.0;
2879 return 400.0 / 360.0 / 60.0;
2885 return 1.0 / 360.0 / 60.0;
2887 return M_PI / 180.0 / 60.0 * 1000;
2889 return 3200.0 / 180.0 / 60.0;
2902 return M_PI / 180.0 / 3600.0;
2904 return 400.0 / 360.0 / 3600.0;
2910 return 1.0 / 360.0 / 3600.0;
2912 return M_PI / 180.0 / 3600.0 * 1000;
2914 return 3200.0 / 180.0 / 3600.0;
2931 return 360.0 * 60.0;
2933 return 360.0 * 3600.0;
2937 return 2 * M_PI * 1000;
2950 return 180.0 / M_PI / 1000;
2954 return 200.0 / M_PI / 1000;
2956 return 180.0 * 60.0 / M_PI / 1000;
2958 return 180.0 * 3600.0 / M_PI / 1000;
2960 return M_PI / 2 / 1000;
2964 return 3200.0 / 1000.0 / M_PI;
2976 return 180.0 / 3200;
2980 return 200.0 / 3200;
2982 return 60 * 180.0 / 3200;
2984 return 3600.0 * 180 / 3200;
2986 return 1.0 / ( 2 * 32000 );
2988 return 1000.0 * M_PI / 3200.0;
3006 int decimalPlaces = 2;
3011 unitLabel = QObject::tr(
"°",
"angle" );
3015 unitLabel = QObject::tr(
" rad",
"angle" );
3019 unitLabel = QObject::tr(
" gon",
"angle" );
3023 unitLabel = QObject::tr(
"′",
"angle minutes" );
3027 unitLabel = QObject::tr(
"″",
"angle seconds" );
3031 unitLabel = QObject::tr(
" tr",
"angle turn" );
3035 unitLabel = QObject::tr(
" millirad",
"angular mil SI" );
3039 unitLabel = QObject::tr(
" mil",
"angular mil NATO" );
3046 if ( decimals >= 0 )
3047 decimalPlaces = decimals;
3049 return QStringLiteral(
"%L1%2" ).arg( angle, 0,
'f', decimalPlaces ).arg( unitLabel );
3066 else if ( std::fabs( distance ) > 1000.0 )
3071 else if ( std::fabs( distance ) < 0.01 )
3076 else if ( std::fabs( distance ) < 0.1 )
3090 if ( keepBaseUnit || std::fabs( distance ) >= 1.0 )
3103 if ( std::fabs( distance ) <= 5280.0 || keepBaseUnit )
3116 if ( std::fabs( distance ) <= 1760.0 || keepBaseUnit )
3129 if ( std::fabs( distance ) >= 1.0 || keepBaseUnit )
3169 result.
value = -1.0;
3374 return QStringLiteral(
"%L1%2" ).arg( distance, 0,
'e', decimals ).arg( unitText );
3378 return QStringLiteral(
"%L1%2" ).arg( dist.
value, 0,
'f', decimals ).arg( unitText );
3394 return QStringLiteral(
"%L1%2" ).arg( area, 0,
'e', decimals ).arg( unitText );
3398 return QStringLiteral(
"%L1%2" ).arg( areaValue.
value, 0,
'f', decimals ).arg( unitText );
3407 return QStringLiteral(
"MM" );
3409 return QStringLiteral(
"RenderMetersInMapUnits" );
3411 return QStringLiteral(
"MapUnit" );
3413 return QStringLiteral(
"Pixel" );
3415 return QStringLiteral(
"Percentage" );
3417 return QStringLiteral(
"Point" );
3419 return QStringLiteral(
"Inch" );
3428 const QString normalized =
string.trimmed().toLower();
3437 if ( normalized == QLatin1String(
"meters" ) )
3441 if ( normalized == QLatin1String(
"mapunits" ) )
3447 if ( normalized == QLatin1String(
"percent" ) )
3451 if ( normalized == QLatin1String(
"points" ) )
3468 return QObject::tr(
"millimeters",
"render" );
3471 return QObject::tr(
"meters at scale",
"render" );
3474 return QObject::tr(
"map units",
"render" );
3477 return QObject::tr(
"pixels",
"render" );
3480 return QObject::tr(
"percent",
"render" );
3483 return QObject::tr(
"points",
"render" );
3486 return QObject::tr(
"inches",
"render" );
3489 return QObject::tr(
"<unknown>",
"render" );
3502 return QStringLiteral(
"cm" );
3504 return QStringLiteral(
"m" );
3506 return QStringLiteral(
"in" );
3508 return QStringLiteral(
"ft" );
3510 return QStringLiteral(
"pt" );
3512 return QStringLiteral(
"pi" );
3514 return QStringLiteral(
"px" );
3516 return QStringLiteral(
"mm" );
3523 const QString normalized =
string.trimmed().toLower();
3577 return QObject::tr(
"px" );
3579 return QObject::tr(
"mm" );
3581 return QObject::tr(
"cm" );
3583 return QObject::tr(
"m" );
3585 return QObject::tr(
"in",
"unit inch" );
3587 return QObject::tr(
"ft" );
3589 return QObject::tr(
"pt" );
3591 return QObject::tr(
"pica" );
3601 return QObject::tr(
"pixels" );
3603 return QObject::tr(
"millimeters" );
3605 return QObject::tr(
"centimeters" );
3607 return QObject::tr(
"meters" );
3609 return QObject::tr(
"inches" );
3611 return QObject::tr(
"feet" );
3613 return QObject::tr(
"points" );
3615 return QObject::tr(
"picas" );
DistanceUnitType
Types of distance units.
@ Geographic
Unit is a geographic (e.g., degree based) unit.
@ Unknown
Unknown unit type.
@ Standard
Unit is a standard measurement unit.
@ Unknown
Unknown unit type.
LayoutUnit
Layout measurement units.
@ Centimeters
Centimeters.
@ Millimeters
Millimeters.
@ Points
Typographic points.
@ Picas
Typographic picas.
AngleUnit
Units of angles.
@ SecondsOfArc
Seconds of arc.
@ Radians
Square kilometers.
@ MinutesOfArc
Minutes of arc.
@ Unknown
Unknown angle unit.
@ MilliradiansSI
Angular milliradians (SI definition, 1/1000 of radian)
@ MilNATO
Angular mil (NATO definition, 6400 mil = 2PI radians)
DistanceUnit
Units of distance.
@ YardsBritishSears1922Truncated
British yards (Sears 1922 truncated)
@ MilesUSSurvey
US Survey miles.
@ LinksBritishSears1922
British links (Sears 1922)
@ YardsBritishBenoit1895A
British yards (Benoit 1895 A)
@ LinksBritishBenoit1895A
British links (Benoit 1895 A)
@ Centimeters
Centimeters.
@ YardsIndian1975
Indian yards (1975)
@ FeetUSSurvey
US Survey feet.
@ Millimeters
Millimeters.
@ FeetBritishSears1922
British feet (Sears 1922)
@ YardsClarkes
Clarke's yards.
@ YardsIndian
Indian yards.
@ FeetBritishBenoit1895B
British feet (Benoit 1895 B)
@ Miles
Terrestrial miles.
@ LinksUSSurvey
US Survey links.
@ ChainsUSSurvey
US Survey chains.
@ FeetClarkes
Clarke's feet.
@ Unknown
Unknown distance unit.
@ FeetBritish1936
British feet (1936)
@ FeetIndian1962
Indian feet (1962)
@ YardsBritishSears1922
British yards (Sears 1922)
@ FeetIndian1937
Indian feet (1937)
@ YardsIndian1937
Indian yards (1937)
@ Degrees
Degrees, for planar geographic CRS distance measurements.
@ ChainsBritishBenoit1895B
British chains (Benoit 1895 B)
@ LinksBritishSears1922Truncated
British links (Sears 1922 truncated)
@ ChainsBritishBenoit1895A
British chains (Benoit 1895 A)
@ YardsBritishBenoit1895B
British yards (Benoit 1895 B)
@ FeetBritish1865
British feet (1865)
@ YardsIndian1962
Indian yards (1962)
@ FeetBritishSears1922Truncated
British feet (Sears 1922 truncated)
@ MetersGermanLegal
German legal meter.
@ LinksBritishBenoit1895B
British links (Benoit 1895 B)
@ ChainsInternational
International chains.
@ LinksInternational
International links.
@ ChainsBritishSears1922Truncated
British chains (Sears 1922 truncated)
@ FeetIndian
Indian (geodetic) feet.
@ NauticalMiles
Nautical miles.
@ ChainsClarkes
Clarke's chains.
@ LinksClarkes
Clarke's links.
@ ChainsBritishSears1922
British chains (Sears 1922)
@ FeetIndian1975
Indian feet (1975)
@ FeetGoldCoast
Gold Coast feet.
@ FeetBritishBenoit1895A
British feet (Benoit 1895 A)
@ SquareCentimeters
Square centimeters.
@ SquareInches
Square inches.
@ SquareNauticalMiles
Square nautical miles.
@ SquareMillimeters
Square millimeters.
@ SquareYards
Square yards.
@ SquareKilometers
Square kilometers.
@ SquareMeters
Square meters.
@ Unknown
Unknown areal unit.
@ SquareDegrees
Square degrees, for planar geographic CRS area measurements.
@ SquareMiles
Square miles.
TemporalUnit
Temporal units.
@ IrregularStep
Special 'irregular step' time unit, used for temporal data which uses irregular, non-real-world unit ...
@ Milliseconds
Milliseconds.
@ Unknown
Unknown time unit.
RenderUnit
Rendering size units.
@ Percentage
Percentage of another measurement (e.g., canvas size, feature size)
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ Unknown
Mixed or unknown units.
@ MetersInMapUnits
Meters value as Map units.
LayoutUnitType
Types of layout units.
@ PaperUnits
Unit is a paper based measurement unit.
@ ScreenUnits
Unit is a screen based measurement unit.
VolumeUnit
Units of volume.
@ CubicMeters
Cubic meters.
@ CubicDegrees
Cubic degrees, for planar geographic CRS volume measurements.
@ CubicDecimeter
Cubic decimeters.
@ Unknown
Unknown volume unit.
@ CubicCentimeter
Cubic Centimeters.
static Q_INVOKABLE Qgis::VolumeUnit decodeVolumeUnit(const QString &string, bool *ok=nullptr)
Decodes a volume unit from a string.
static Q_INVOKABLE Qgis::DistanceUnit stringToDistanceUnit(const QString &string, bool *ok=nullptr)
Converts a translated string to a distance unit.
static Q_INVOKABLE QgsUnitTypes::AreaValue scaledArea(double area, Qgis::AreaUnit unit, int decimals, bool keepBaseUnit=false)
Will convert an area with a given unit to an area value which is nice to display.
static Q_INVOKABLE QgsUnitTypes::DistanceValue scaledDistance(double distance, Qgis::DistanceUnit unit, int decimals, bool keepBaseUnit=false)
Will convert a distance with a given unit to a distance value which is nice to display.
static Q_INVOKABLE QString toString(Qgis::DistanceUnit unit)
Returns a translated string representing a distance unit.
static Q_INVOKABLE QString formatArea(double area, int decimals, Qgis::AreaUnit unit, bool keepBaseUnit=false)
Returns an area formatted as a friendly string.
static Q_INVOKABLE double fromUnitToUnitFactor(Qgis::DistanceUnit fromUnit, Qgis::DistanceUnit toUnit)
Returns the conversion factor between the specified distance units.
static Q_INVOKABLE Qgis::VolumeUnit stringToVolumeUnit(const QString &string, bool *ok=nullptr)
Converts a translated string to a volume unit.
static Q_INVOKABLE QString formatDistance(double distance, int decimals, Qgis::DistanceUnit unit, bool keepBaseUnit=false)
Returns an distance formatted as a friendly string.
static Q_INVOKABLE QString toAbbreviatedString(Qgis::DistanceUnit unit)
Returns a translated abbreviation representing a distance unit.
static Q_INVOKABLE Qgis::DistanceUnitType unitType(Qgis::DistanceUnit unit)
Returns the type for a distance unit.
static Q_INVOKABLE Qgis::UnitType decodeUnitType(const QString &string, bool *ok=nullptr)
Decodes a unit type from a string.
static Q_INVOKABLE Qgis::AreaUnit decodeAreaUnit(const QString &string, bool *ok=nullptr)
Decodes an areal unit from a string.
static Q_INVOKABLE Qgis::RenderUnit decodeRenderUnit(const QString &string, bool *ok=nullptr)
Decodes a render unit from a string.
static Q_INVOKABLE Qgis::TemporalUnit stringToTemporalUnit(const QString &string, bool *ok=nullptr)
Converts a translated string to a temporal unit.
static Q_INVOKABLE Qgis::LayoutUnit decodeLayoutUnit(const QString &string, bool *ok=nullptr)
Decodes a layout unit from a string.
static Q_INVOKABLE Qgis::AreaUnit stringToAreaUnit(const QString &string, bool *ok=nullptr)
Converts a translated string to an areal unit.
static Q_INVOKABLE Qgis::AreaUnit distanceToAreaUnit(Qgis::DistanceUnit distanceUnit)
Converts a distance unit to its corresponding area unit, e.g., meters to square meters.
static Q_INVOKABLE Qgis::TemporalUnit decodeTemporalUnit(const QString &string, bool *ok=nullptr)
Decodes a temporal unit from a string.
static Q_INVOKABLE Qgis::AngleUnit decodeAngleUnit(const QString &string, bool *ok=nullptr)
Decodes an angular unit from a string.
static Q_INVOKABLE Qgis::DistanceUnit areaToDistanceUnit(Qgis::AreaUnit areaUnit)
Converts an area unit to its corresponding distance unit, e.g., square meters to meters.
static Q_INVOKABLE Qgis::DistanceUnit volumeToDistanceUnit(Qgis::VolumeUnit volumeUnit)
Converts a volume unit to its corresponding distance unit, e.g., cubic meters to meters.
static Q_INVOKABLE QString encodeUnit(Qgis::DistanceUnit unit)
Encodes a distance unit to a string.
static Q_INVOKABLE QString encodeUnitType(Qgis::UnitType type)
Encodes a unit type to a string.
static Q_INVOKABLE QString formatAngle(double angle, int decimals, Qgis::AngleUnit unit)
Returns an angle formatted as a friendly string.
static Q_INVOKABLE Qgis::VolumeUnit distanceToVolumeUnit(Qgis::DistanceUnit distanceUnit)
Converts a distance unit to its corresponding volume unit, e.g., meters to cubic meters.
static Q_INVOKABLE Qgis::DistanceUnit decodeDistanceUnit(const QString &string, bool *ok=nullptr)
Decodes a distance unit from a string.
double qgsRound(double number, int places)
Returns a double number, rounded (as close as possible) to the specified number of places.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
constexpr double distanceUnitToMeter(Qgis::DistanceUnit unit)
A combination of area value and unit.
double value
The value part of the distance.
Qgis::AreaUnit unit
The value part of the distance.
A combination of distance value and unit.
double value
The value part of the distance.
Qgis::DistanceUnit unit
The value part of the distance.