"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/src/python/test_qgsgeometry.py" between
QGIS-final-3_10_5.tar.gz and QGIS-final-3_10_6.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Long-term release (3.10.x series).

test_qgsgeometry.py  (QGIS-final-3_10_5):test_qgsgeometry.py  (QGIS-final-3_10_6)
skipping to change at line 2808 skipping to change at line 2808
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiSurfaceM), QgsWk bTypes.MultiSurfaceM) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiSurfaceM), QgsWk bTypes.MultiSurfaceM)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiSurfaceZM), QgsW kbTypes.MultiSurfaceZM) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiSurfaceZM), QgsW kbTypes.MultiSurfaceZM)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.NoGeometry), QgsWkbTy pes.NoGeometry) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.NoGeometry), QgsWkbTy pes.NoGeometry)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.Point25D), QgsWkbType s.MultiPoint25D) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.Point25D), QgsWkbType s.MultiPoint25D)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.LineString25D), QgsWk bTypes.CompoundCurveZ) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.LineString25D), QgsWk bTypes.CompoundCurveZ)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.Polygon25D), QgsWkbTy pes.CurvePolygonZ) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.Polygon25D), QgsWkbTy pes.CurvePolygonZ)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiPoint25D), QgsWk bTypes.MultiPoint25D) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiPoint25D), QgsWk bTypes.MultiPoint25D)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiLineString25D), QgsWkbTypes.MultiCurveZ) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiLineString25D), QgsWkbTypes.MultiCurveZ)
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiPolygon25D), Qgs WkbTypes.MultiSurfaceZ) self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.MultiPolygon25D), Qgs WkbTypes.MultiSurfaceZ)
# test linearType method
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.Unknown), QgsWkbType
s.Unknown)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.Point), QgsWkbTypes.
Point)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.PointZ), QgsWkbTypes
.PointZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.PointM), QgsWkbTypes
.PointM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.PointZM), QgsWkbType
s.PointZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPoint), QgsWkbT
ypes.MultiPoint)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPointZ), QgsWkb
Types.MultiPointZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPointM), QgsWkb
Types.MultiPointM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPointZM), QgsWk
bTypes.MultiPointZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.LineString), QgsWkbT
ypes.LineString)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.LineStringZ), QgsWkb
Types.LineStringZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.LineStringM), QgsWkb
Types.LineStringM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.LineStringZM), QgsWk
bTypes.LineStringZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiLineString), Qg
sWkbTypes.MultiLineString)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiLineStringZ), Q
gsWkbTypes.MultiLineStringZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiLineStringM), Q
gsWkbTypes.MultiLineStringM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiLineStringZM),
QgsWkbTypes.MultiLineStringZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.Polygon), QgsWkbType
s.Polygon)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.PolygonZ), QgsWkbTyp
es.PolygonZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.PolygonM), QgsWkbTyp
es.PolygonM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.PolygonZM), QgsWkbTy
pes.PolygonZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPolygon), QgsWk
bTypes.MultiPolygon)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPolygonZ), QgsW
kbTypes.MultiPolygonZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPolygonM), QgsW
kbTypes.MultiPolygonM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPolygonZM), Qgs
WkbTypes.MultiPolygonZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.GeometryCollection),
QgsWkbTypes.GeometryCollection)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.GeometryCollectionZ)
, QgsWkbTypes.GeometryCollectionZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.GeometryCollectionM)
, QgsWkbTypes.GeometryCollectionM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.GeometryCollectionZM
), QgsWkbTypes.GeometryCollectionZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CircularString), Qgs
WkbTypes.LineString)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CircularStringZ), Qg
sWkbTypes.LineStringZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CircularStringM), Qg
sWkbTypes.LineStringM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CircularStringZM), Q
gsWkbTypes.LineStringZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CompoundCurve), QgsW
kbTypes.LineString)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CompoundCurveZ), Qgs
WkbTypes.LineStringZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CompoundCurveM), Qgs
WkbTypes.LineStringM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CompoundCurveZM), Qg
sWkbTypes.LineStringZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CurvePolygon), QgsWk
bTypes.Polygon)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CurvePolygonZ), QgsW
kbTypes.PolygonZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CurvePolygonM), QgsW
kbTypes.PolygonM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.CurvePolygonZM), Qgs
WkbTypes.PolygonZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiCurve), QgsWkbT
ypes.MultiLineString)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiCurveZ), QgsWkb
Types.MultiLineStringZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiCurveM), QgsWkb
Types.MultiLineStringM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiCurveZM), QgsWk
bTypes.MultiLineStringZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiSurface), QgsWk
bTypes.MultiPolygon)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiSurfaceZ), QgsW
kbTypes.MultiPolygonZ)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiSurfaceM), QgsW
kbTypes.MultiPolygonM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiSurfaceZM), Qgs
WkbTypes.MultiPolygonZM)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.NoGeometry), QgsWkbT
ypes.NoGeometry)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.Point25D), QgsWkbTyp
es.Point25D)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.LineString25D), QgsW
kbTypes.LineString25D)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.Polygon25D), QgsWkbT
ypes.Polygon25D)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPoint25D), QgsW
kbTypes.MultiPoint25D)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiLineString25D),
QgsWkbTypes.MultiLineString25D)
self.assertEqual(QgsWkbTypes.linearType(QgsWkbTypes.MultiPolygon25D), Qg
sWkbTypes.MultiPolygon25D)
# test flatType method # test flatType method
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.Unknown), QgsWkbTypes. Unknown) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.Unknown), QgsWkbTypes. Unknown)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.Point), QgsWkbTypes.Po int) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.Point), QgsWkbTypes.Po int)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.PointZ), QgsWkbTypes.P oint) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.PointZ), QgsWkbTypes.P oint)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.PointM), QgsWkbTypes.P oint) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.PointM), QgsWkbTypes.P oint)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.PointZM), QgsWkbTypes. Point) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.PointZM), QgsWkbTypes. Point)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPoint), QgsWkbTyp es.MultiPoint) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPoint), QgsWkbTyp es.MultiPoint)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPointZ), QgsWkbTy pes.MultiPoint) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPointZ), QgsWkbTy pes.MultiPoint)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPointM), QgsWkbTy pes.MultiPoint) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPointM), QgsWkbTy pes.MultiPoint)
self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPointZM), QgsWkbT ypes.MultiPoint) self.assertEqual(QgsWkbTypes.flatType(QgsWkbTypes.MultiPointZM), QgsWkbT ypes.MultiPoint)
skipping to change at line 5306 skipping to change at line 5364
self.assertEqual(res, res2) self.assertEqual(res, res2)
def testLineStringFromQPolygonF(self): def testLineStringFromQPolygonF(self):
line = QgsLineString.fromQPolygonF(QPolygonF()) line = QgsLineString.fromQPolygonF(QPolygonF())
self.assertEqual(line.asWkt(0), 'LineString EMPTY') self.assertEqual(line.asWkt(0), 'LineString EMPTY')
line = QgsLineString.fromQPolygonF(QPolygonF([QPointF(1, 2), QPointF(3, 4)])) line = QgsLineString.fromQPolygonF(QPolygonF([QPointF(1, 2), QPointF(3, 4)]))
self.assertEqual(line.asWkt(1), 'LineString (1 2, 3 4)') self.assertEqual(line.asWkt(1), 'LineString (1 2, 3 4)')
line = QgsLineString.fromQPolygonF(QPolygonF([QPointF(1.5, 2.5), QPointF (3, 4), QPointF(3, 6.5), QPointF(1.5, 2.5)])) line = QgsLineString.fromQPolygonF(QPolygonF([QPointF(1.5, 2.5), QPointF (3, 4), QPointF(3, 6.5), QPointF(1.5, 2.5)]))
self.assertEqual(line.asWkt(1), 'LineString (1.5 2.5, 3 4, 3 6.5, 1.5 2. 5)') self.assertEqual(line.asWkt(1), 'LineString (1.5 2.5, 3 4, 3 6.5, 1.5 2. 5)')
def testGeosCrash(self):
# test we don't crash when geos returns a point geometry with no points
QgsGeometry.fromWkt('Polygon ((0 0, 1 1, 1 0, 0 0))').intersection(QgsGe
ometry.fromWkt('Point (42 0)')).isNull()
def renderGeometry(self, geom, use_pen, as_polygon=False, as_painter_path=Fa lse): def renderGeometry(self, geom, use_pen, as_polygon=False, as_painter_path=Fa lse):
image = QImage(200, 200, QImage.Format_RGB32) image = QImage(200, 200, QImage.Format_RGB32)
image.fill(QColor(0, 0, 0)) image.fill(QColor(0, 0, 0))
painter = QPainter(image) painter = QPainter(image)
if use_pen: if use_pen:
painter.setPen(QPen(QColor(255, 255, 255), 4)) painter.setPen(QPen(QColor(255, 255, 255), 4))
else: else:
painter.setBrush(QBrush(QColor(255, 255, 255))) painter.setBrush(QBrush(QColor(255, 255, 255)))
 End of changes. 2 change blocks. 
0 lines changed or deleted 119 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)