|
1 |
| -/** \ingroup core |
2 |
| - * \class QgsCoordinateFormatter |
3 |
| - * \brief Contains methods for converting coordinates for display in various formats. |
4 |
| - * |
5 |
| - * QgsCoordinateFormatter contains static methods for converting numeric coordinates into different |
6 |
| - * formats, for instance as degrees, minutes, seconds values. Note that QgsCoordinateFormatter has |
7 |
| - * no consideration for the validity of converting coordinates to the various display formats, and it |
8 |
| - * is up to the caller to ensure that sensible formats are used for particular coordinates. For instance, |
9 |
| - * ensuring that only geographic coordinates and not projected coordinates are formatted to degree |
10 |
| - * based formats. |
11 |
| - * |
12 |
| - * \note Added in version 2.14 |
13 |
| - */ |
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/qgscoordinateformatter.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
14 | 12 |
|
15 | 13 | class QgsCoordinateFormatter
|
16 | 14 | {
|
17 |
| -%TypeHeaderCode |
18 |
| -#include <qgscoordinateformatter.h> |
| 15 | +%Docstring |
| 16 | + Contains methods for converting coordinates for display in various formats. |
| 17 | + |
| 18 | + QgsCoordinateFormatter contains static methods for converting numeric coordinates into different |
| 19 | + formats, for instance as degrees, minutes, seconds values. Note that QgsCoordinateFormatter has |
| 20 | + no consideration for the validity of converting coordinates to the various display formats, and it |
| 21 | + is up to the caller to ensure that sensible formats are used for particular coordinates. For instance, |
| 22 | + ensuring that only geographic coordinates and not projected coordinates are formatted to degree |
| 23 | + based formats. |
| 24 | + |
| 25 | +.. note:: |
| 26 | + |
| 27 | + Added in version 2.14 |
19 | 28 | %End
|
20 | 29 |
|
| 30 | +%TypeHeaderCode |
| 31 | +#include "qgscoordinateformatter.h" |
| 32 | +%End |
21 | 33 | public:
|
22 | 34 |
|
23 |
| - /** Available formats for displaying coordinates. |
24 |
| - */ |
25 | 35 | enum Format
|
26 | 36 | {
|
27 |
| - Pair, /*!< Formats coordinates as an "x,y" pair */ |
28 |
| - DegreesMinutesSeconds, /*!< Degrees, minutes and seconds, eg 30 degrees 45'30" */ |
29 |
| - DegreesMinutes, /*!< Degrees and decimal minutes, eg 30degrees 45.55' */ |
30 |
| - DecimalDegrees, /*!< Decimal degrees, eg 30.7555 degrees */ |
| 37 | + Pair, |
| 38 | + DegreesMinutesSeconds, |
| 39 | + DegreesMinutes, |
| 40 | + DecimalDegrees, |
31 | 41 | };
|
32 | 42 |
|
33 |
| - /** Flags for controlling formatting of coordinates. |
34 |
| - */ |
35 | 43 | enum FormatFlag
|
36 | 44 | {
|
37 |
| - DegreesUseStringSuffix, /*!< include a direction suffix (eg 'N', 'E', 'S' or 'W'), otherwise a "-" prefix is used for west and south coordinates */ |
38 |
| - DegreesPadMinutesSeconds, /*!< pad minute and second values with leading zeros, eg '05' instead of '5' */ |
| 45 | + DegreesUseStringSuffix, |
| 46 | + DegreesPadMinutesSeconds, |
39 | 47 | };
|
40 | 48 | typedef QFlags<QgsCoordinateFormatter::FormatFlag> FormatFlags;
|
41 | 49 |
|
42 |
| - /** Formats an X coordinate value according to the specified parameters. |
43 |
| - * @param x x-coordinate |
44 |
| - * @param format string format to use for coordinate |
45 |
| - * @param precision number of decimal places to include |
46 |
| - * @param flags flags controlling format options |
47 |
| - * @returns formatted X coordinate string |
48 |
| - * @see formatY() |
49 |
| - */ |
| 50 | + |
50 | 51 | static QString formatX( double x, Format format, int precision = 12, FormatFlags flags = DegreesUseStringSuffix );
|
| 52 | +%Docstring |
| 53 | + Formats an X coordinate value according to the specified parameters. |
| 54 | + @param x x-coordinate |
| 55 | + @param format string format to use for coordinate |
| 56 | + @param precision number of decimal places to include |
| 57 | + @param flags flags controlling format options |
| 58 | + @returns formatted X coordinate string |
| 59 | + @see formatY() |
| 60 | + :rtype: str |
| 61 | +%End |
51 | 62 |
|
52 |
| - /** Formats an Y coordinate value according to the specified parameters. |
53 |
| - * @param y y-coordinate |
54 |
| - * @param format string format to use for coordinate |
55 |
| - * @param precision number of decimal places to include |
56 |
| - * @param flags flags controlling format options |
57 |
| - * @returns formatted Y coordinate string |
58 |
| - * @see formatX() |
59 |
| - */ |
60 | 63 | static QString formatY( double y, Format format, int precision = 12, FormatFlags flags = DegreesUseStringSuffix );
|
| 64 | +%Docstring |
| 65 | + Formats an Y coordinate value according to the specified parameters. |
| 66 | + @param y y-coordinate |
| 67 | + @param format string format to use for coordinate |
| 68 | + @param precision number of decimal places to include |
| 69 | + @param flags flags controlling format options |
| 70 | + @returns formatted Y coordinate string |
| 71 | + @see formatX() |
| 72 | + :rtype: str |
| 73 | +%End |
61 | 74 |
|
62 |
| - /** Formats coordinates as an "x,y" pair, with optional decimal precision. |
63 |
| - * @param x x-coordinate |
64 |
| - * @param y y-coordinate |
65 |
| - * @param precision number of decimal places to include |
66 |
| - * @returns formatted coordinate string |
67 |
| - */ |
68 | 75 | static QString asPair( double x, double y, int precision = 12 );
|
| 76 | +%Docstring |
| 77 | + Formats coordinates as an "x,y" pair, with optional decimal precision. |
| 78 | + @param x x-coordinate |
| 79 | + @param y y-coordinate |
| 80 | + @param precision number of decimal places to include |
| 81 | + @returns formatted coordinate string |
| 82 | + :rtype: str |
| 83 | +%End |
69 | 84 |
|
70 | 85 | };
|
| 86 | + |
| 87 | +/************************************************************************ |
| 88 | + * This file has been generated automatically from * |
| 89 | + * * |
| 90 | + * src/core/qgscoordinateformatter.h * |
| 91 | + * * |
| 92 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 93 | + ************************************************************************/ |
0 commit comments