Skip to content
Permalink
Browse files
Fix tests in test_qgsgeometry.py with geos 3.9
  • Loading branch information
lbartoletti authored and nyalldawson committed Apr 9, 2021
1 parent d387093 commit 1d29a42cd97ff842943dec856c5bf4a741fe2317
Showing with 147 additions and 10 deletions.
  1. +35 −0 python/core/auto_generated/qgis.sip.in
  2. +26 −0 src/core/qgis.cpp
  3. +35 −0 src/core/qgis.h
  4. +51 −10 tests/src/python/test_qgsgeometry.py
@@ -125,6 +125,41 @@ The development version
A string with default project scales.

.. versionadded:: 3.12
%End

static int geosVersionInt();
%Docstring
GEOS version number linked

.. versionadded:: 3.18
%End

static int geosVersionMajor();
%Docstring
GEOS Major version number linked

.. versionadded:: 3.18
%End

static int geosVersionMinor();
%Docstring
GEOS Minor version number linked

.. versionadded:: 3.18
%End

static int geosVersionPatch();
%Docstring
GEOS Patch version number linked

.. versionadded:: 3.18
%End

static QString geosVersion();
%Docstring
GEOS string version linked

.. versionadded:: 3.18
%End
};

@@ -30,6 +30,7 @@
#include "qgswkbtypes.h"

#include <gdal.h>
#include <geos_c.h>
#include <ogr_api.h>

// Version constants
@@ -298,6 +299,31 @@ QString Qgis::devVersion()
return QString::fromUtf8( QGIS_DEV_VERSION );
}

QString Qgis::geosVersion()
{
return GEOSversion();
}

int Qgis::geosVersionInt()
{
return QStringLiteral( "%1%2%3" ).arg( GEOS_VERSION_MAJOR, 2, 10, QChar( '0' ) ).arg( GEOS_VERSION_MINOR, 2, 10, QChar( '0' ) ).arg( GEOS_VERSION_PATCH, 2, 10, QChar( '0' ) ).toInt();
}

int Qgis::geosVersionMajor()
{
return GEOS_VERSION_MAJOR;
}

int Qgis::geosVersionMinor()
{
return GEOS_VERSION_MINOR;
}

int Qgis::geosVersionPatch()
{
return GEOS_VERSION_PATCH;
}

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template<>
bool qMapLessThanKey<QVariantList>( const QVariantList &key1, const QVariantList &key2 )
@@ -200,6 +200,41 @@ class CORE_EXPORT Qgis
* \since QGIS 3.12
*/
static QString defaultProjectScales();

/**
* GEOS version number linked
*
* \since QGIS 3.18
*/
static int geosVersionInt();

/**
* GEOS Major version number linked
*
* \since QGIS 3.18
*/
static int geosVersionMajor();

/**
* GEOS Minor version number linked
*
* \since QGIS 3.18
*/
static int geosVersionMinor();

/**
* GEOS Patch version number linked
*
* \since QGIS 3.18
*/
static int geosVersionPatch();

/**
* GEOS string version linked
*
* \since QGIS 3.18
*/
static QString geosVersion();
};

// hack to workaround warnings when casting void pointers

0 comments on commit 1d29a42

Please sign in to comment.