1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinateformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsCoordinateFormatter
{
%Docstring(signature="appended")
Contains methods for converting coordinates for display in various
formats.
:py:class:`QgsCoordinateFormatter` contains static methods for
converting numeric coordinates into different formats, for instance as
degrees, minutes, seconds values. Note that
:py:class:`QgsCoordinateFormatter` has no consideration for the validity
of converting coordinates to the various display formats, and it is up
to the caller to ensure that sensible formats are used for particular
coordinates. For instance, ensuring that only geographic coordinates and
not projected coordinates are formatted to degree based formats.
%End
%TypeHeaderCode
#include "qgscoordinateformatter.h"
%End
public:
enum Format /BaseType=IntEnum/
{
FormatPair,
FormatDegreesMinutesSeconds,
FormatDegreesMinutes,
FormatDecimalDegrees,
};
enum FormatFlag /BaseType=IntEnum/
{
FlagDegreesUseStringSuffix,
FlagDegreesPadMinutesSeconds,
};
typedef QFlags<QgsCoordinateFormatter::FormatFlag> FormatFlags;
static QString formatX( double x, Format format, int precision = 12, FormatFlags flags = FlagDegreesUseStringSuffix );
%Docstring
Formats an ``x`` coordinate value according to the specified parameters.
The ``format`` argument indicates the desired display format for the
coordinate.
The ``precision`` argument gives the number of decimal places to include
for coordinates.
Optional ``flags`` can be specified to control the output format.
.. seealso:: :py:func:`formatY`
%End
static QString formatY( double y, Format format, int precision = 12, FormatFlags flags = FlagDegreesUseStringSuffix );
%Docstring
Formats a ``y`` coordinate value according to the specified parameters.
The ``format`` argument indicates the desired display format for the
coordinate.
The ``precision`` argument gives the number of decimal places to include
for coordinates.
Optional ``flags`` can be specified to control the output format.
.. seealso:: :py:func:`formatX`
%End
static QString format( const QgsPointXY &point, Format format, int precision = 12, FormatFlags flags = FlagDegreesUseStringSuffix, Qgis::CoordinateOrder order = Qgis::CoordinateOrder::XY );
%Docstring
Formats a ``point`` according to the specified parameters.
The ``format`` argument indicates the desired display format for the
coordinate.
The ``precision`` argument gives the number of decimal places to include
for coordinates.
Optional ``flags`` can be specified to control the output format.
Since QGIS 3.26 the optional ``order`` argument can be used to control
the order of the coordinates.
%End
static QString asPair( double x, double y, int precision = 12, Qgis::CoordinateOrder order = Qgis::CoordinateOrder::XY );
%Docstring
Formats coordinates as an "``x``,``y``" pair, with optional decimal
``precision`` (number of decimal places to include).
Since QGIS 3.26 the optional ``order`` argument can be used to control
the order of the coordinates.
%End
static QChar separator( );
%Docstring
Returns the character used as X/Y separator, this is a `,` on locales
that do not use `,` as decimal separator, it is a space otherwise.
.. versionadded:: 3.20
%End
};
QFlags<QgsCoordinateFormatter::FormatFlag> operator|(QgsCoordinateFormatter::FormatFlag f1, QFlags<QgsCoordinateFormatter::FormatFlag> f2);
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinateformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|