Skip to content

Commit

Permalink
Update sip bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 15, 2017
1 parent 916c56b commit 8fd8b6e
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 47 deletions.
1 change: 1 addition & 0 deletions python/core/core_auto.sip
Expand Up @@ -21,6 +21,7 @@
%Include qgscolorscheme.sip
%Include qgscolorschemeregistry.sip
%Include qgsconditionalstyle.sip
%Include qgscoordinateformatter.sip
%Include qgscoordinatetransform.sip
%Include qgscrscache.sip
%Include qgsdartmeasurement.sip
Expand Down
117 changes: 70 additions & 47 deletions python/core/qgscoordinateformatter.sip
@@ -1,70 +1,93 @@
/** \ingroup core
* \class QgsCoordinateFormatter
* \brief 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
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinateformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsCoordinateFormatter
{
%TypeHeaderCode
#include <qgscoordinateformatter.h>
%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
%End

%TypeHeaderCode
#include "qgscoordinateformatter.h"
%End
public:

/** Available formats for displaying coordinates.
*/
enum Format
{
Pair, /*!< Formats coordinates as an "x,y" pair */
DegreesMinutesSeconds, /*!< Degrees, minutes and seconds, eg 30 degrees 45'30" */
DegreesMinutes, /*!< Degrees and decimal minutes, eg 30degrees 45.55' */
DecimalDegrees, /*!< Decimal degrees, eg 30.7555 degrees */
Pair,
DegreesMinutesSeconds,
DegreesMinutes,
DecimalDegrees,
};

/** Flags for controlling formatting of coordinates.
*/
enum FormatFlag
{
DegreesUseStringSuffix, /*!< include a direction suffix (eg 'N', 'E', 'S' or 'W'), otherwise a "-" prefix is used for west and south coordinates */
DegreesPadMinutesSeconds, /*!< pad minute and second values with leading zeros, eg '05' instead of '5' */
DegreesUseStringSuffix,
DegreesPadMinutesSeconds,
};
typedef QFlags<QgsCoordinateFormatter::FormatFlag> FormatFlags;

/** 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()
*/

static QString formatX( double x, Format format, int precision = 12, FormatFlags flags = DegreesUseStringSuffix );
%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

/** 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()
*/
static QString formatY( double y, Format format, int precision = 12, FormatFlags flags = DegreesUseStringSuffix );
%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

/** 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
*/
static QString asPair( double x, double y, int precision = 12 );
%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

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinateformatter.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

0 comments on commit 8fd8b6e

Please sign in to comment.