2017-11-15 07:58:29 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgscoordinateformatter.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-16 07:51:03 +11:00
|
|
|
|
|
|
|
class QgsCoordinateFormatter
|
|
|
|
{
|
2017-11-15 07:58:29 +10:00
|
|
|
%Docstring
|
|
|
|
Contains methods for converting coordinates for display in various formats.
|
|
|
|
|
|
|
|
QgsCoordinateFormatter contains static methods for converting numeric coordinates into different
|
|
|
|
formats, for instance as degrees, minutes, seconds values. Note that 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.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
Added in version 2.14
|
2015-12-16 07:51:03 +11:00
|
|
|
%End
|
|
|
|
|
2017-11-15 07:58:29 +10:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscoordinateformatter.h"
|
|
|
|
%End
|
2015-12-16 07:51:03 +11:00
|
|
|
public:
|
|
|
|
|
|
|
|
enum Format
|
|
|
|
{
|
2017-11-15 07:58:29 +10:00
|
|
|
Pair,
|
|
|
|
DegreesMinutesSeconds,
|
|
|
|
DegreesMinutes,
|
|
|
|
DecimalDegrees,
|
2015-12-16 07:51:03 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
enum FormatFlag
|
|
|
|
{
|
2017-11-15 07:58:29 +10:00
|
|
|
DegreesUseStringSuffix,
|
|
|
|
DegreesPadMinutesSeconds,
|
2015-12-16 07:51:03 +11:00
|
|
|
};
|
|
|
|
typedef QFlags<QgsCoordinateFormatter::FormatFlag> FormatFlags;
|
|
|
|
|
2017-11-15 07:58:29 +10:00
|
|
|
|
2015-12-16 07:51:03 +11:00
|
|
|
static QString formatX( double x, Format format, int precision = 12, FormatFlags flags = DegreesUseStringSuffix );
|
2017-11-15 07:58:29 +10:00
|
|
|
%Docstring
|
|
|
|
Formats an X coordinate value according to the specified parameters.
|
|
|
|
@param x x-coordinate
|
|
|
|
@param format string format to use for coordinate
|
|
|
|
@param precision number of decimal places to include
|
|
|
|
@param flags flags controlling format options
|
|
|
|
@returns formatted X coordinate string
|
|
|
|
@see formatY()
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-16 07:51:03 +11:00
|
|
|
|
|
|
|
static QString formatY( double y, Format format, int precision = 12, FormatFlags flags = DegreesUseStringSuffix );
|
2017-11-15 07:58:29 +10:00
|
|
|
%Docstring
|
|
|
|
Formats an Y coordinate value according to the specified parameters.
|
|
|
|
@param y y-coordinate
|
|
|
|
@param format string format to use for coordinate
|
|
|
|
@param precision number of decimal places to include
|
|
|
|
@param flags flags controlling format options
|
|
|
|
@returns formatted Y coordinate string
|
|
|
|
@see formatX()
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-16 07:51:03 +11:00
|
|
|
|
|
|
|
static QString asPair( double x, double y, int precision = 12 );
|
2017-11-15 07:58:29 +10:00
|
|
|
%Docstring
|
|
|
|
Formats coordinates as an "x,y" pair, with optional decimal precision.
|
|
|
|
@param x x-coordinate
|
|
|
|
@param y y-coordinate
|
|
|
|
@param precision number of decimal places to include
|
|
|
|
@returns formatted coordinate string
|
|
|
|
:rtype: str
|
|
|
|
%End
|
2015-12-16 07:51:03 +11:00
|
|
|
|
|
|
|
};
|
2017-11-15 07:58:29 +10:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgscoordinateformatter.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|