Skip to content
Permalink
Browse files
Removed ewkt conversion test
  • Loading branch information
domi4484 committed Jan 10, 2022
1 parent d7a58c6 commit 4310b3f472fdab8334c608041cae4ce982cbfd3f
@@ -163,6 +163,7 @@ Construct a new QgsReferencedGeometry from referenced ``point``
Construct a new QgsReferencedGeometry from referenced ``rectangle``
%End


SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsReferencedGeometry: %1 (%2)>" ).arg( sipCpp->asWkt(), sipCpp->crs().authid() );
@@ -183,6 +183,7 @@ class CORE_EXPORT QgsReferencedGeometry : public QgsGeometry, public QgsReferenc
*/
static QgsReferencedGeometry fromReferencedRect( const QgsReferencedRectangle &rectangle );


#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
% MethodCode
@@ -63,7 +63,6 @@
#include "qgsvectorlayerdiagramprovider.h"
#include "qgsvectorlayerlabelprovider.h"
#include "qgsgeometry.h"
#include "qgsreferencedgeometry.h"
#include "qgsmarkersymbollayer.h"
#include "qgspainting.h"
#include "qgsproject.h"
@@ -14,7 +14,6 @@

from qgis.core import (QgsRectangle,
QgsPointXY,
QgsReferencedGeometry,
QgsReferencedRectangle,
QgsReferencedPointXY,
QgsCoordinateReferenceSystem)
@@ -99,18 +98,6 @@ def testPoint(self):
point2 = QgsReferencedPointXY(QgsPointXY(1.1, 2.0), QgsCoordinateReferenceSystem('epsg:3111'))
self.assertNotEqual(point, point2)

def testEwktToWkt(self):

referencedGeometry = QgsReferencedGeometry.fromEwkt('SRID=2056;Point (-1824522.133701167 -3591183.4426016295)')
self.assertEqual(referencedGeometry.asEwkt(4), 'SRID=2056;Point (-1824522.1337 -3591183.4426)')

referencedGeometryPoint = QgsReferencedGeometry.fromEwkt('SRID=2056;Point (10 10)').asPoint()
self.assertTrue(referencedGeometryPoint)
self.assertEqual(referencedGeometryPoint.x(), 10)

referencedGeometryInvalid = QgsReferencedGeometry.fromEwkt('INVALID=2056;Point (-1824522.133701167 -3591183.4426016295)')
self.assertFalse(referencedGeometryInvalid)


if __name__ == '__main__':
unittest.main()

0 comments on commit 4310b3f

Please sign in to comment.