Skip to content
Permalink
Browse files

Update some use of QgsCoordinateReferenceSystem

  • Loading branch information
DelazJ authored and nyalldawson committed Mar 4, 2020
1 parent c398a26 commit 1eae00e07a8e264bd463f5da62279f91a6d44ea9
@@ -392,7 +392,7 @@ def set_bbox_from_map(self):

if crsid != 4326: # reproject to EPSG:4326
src = QgsCoordinateReferenceSystem(crsid)
dest = QgsCoordinateReferenceSystem(4326)
dest = QgsCoordinateReferenceSystem("EPSG:4326")
xform = QgsCoordinateTransform(src, dest, QgsProject.instance())
minxy = xform.transform(QgsPointXY(extent.xMinimum(),
extent.yMinimum()))
@@ -562,7 +562,7 @@ def record_clicked(self):
if record.bbox is not None:
points = bbox_to_polygon(record.bbox)
if points is not None:
src = QgsCoordinateReferenceSystem(4326)
src = QgsCoordinateReferenceSystem("EPSG:4326")
dst = self.map.mapSettings().destinationCrs()
geom = QgsGeometry.fromWkt(points)
if src.postgisSrid() != dst.postgisSrid():
@@ -209,7 +209,7 @@ def updateInputLayer(self):

srcCrs = self.inLayer.crs()
if not srcCrs.isValid():
srcCrs = QgsCoordinateReferenceSystem(4326)
srcCrs = QgsCoordinateReferenceSystem("EPSG:4326")
self.widgetSourceSrid.setCrs(srcCrs)
self.widgetTargetSrid.setCrs(srcCrs)

@@ -62,7 +62,7 @@ def _make_layer(self, layer_wkb_name):
wkb_type = getattr(QgsWkbTypes, layer_wkb_name)
fields.append(QgsField('int_f', QVariant.Int))
layer = QgsMemoryProviderUtils.createMemoryLayer(
'%s_layer' % layer_wkb_name, fields, wkb_type, QgsCoordinateReferenceSystem(4326))
'%s_layer' % layer_wkb_name, fields, wkb_type, QgsCoordinateReferenceSystem("EPSG:4326"))
self.assertTrue(layer.isValid())
self.assertEqual(layer.wkbType(), wkb_type)
return layer

0 comments on commit 1eae00e

Please sign in to comment.
You can’t perform that action at this time.