Skip to main content
added 64 characters in body; edited tags; edited title
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

How to make crs Making CRS transformation of a QgsVectorLayer? with PyQGIS

I need to transform QgsVectorLayersQgsVectorLayers in pythonPyQGIS from one crsCRS into another crs. By googling I found the following solution (https://qgis.readthedocs.org/en/latest/docs/pyqgis_developer_cookbook/05_crs.html)PyQGIS Developer Cookbook, which works for points only:

crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84
crsDest = QgsCoordinateReferenceSystem(32633)  # WGS 84 / UTM zone 33N
xform = QgsCoordinateTransform(crsSrc, crsDest)
pt1 = xform.transform(QgsPoint(18,5))
crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84
crsDest = QgsCoordinateReferenceSystem(32633)  # WGS 84 / UTM zone 33N
xform = QgsCoordinateTransform(crsSrc, crsDest)
pt1 = xform.transform(QgsPoint(18, 5))

Is there a way to make a crsCRS transformation of an entire layer?

How to make crs transformation of a QgsVectorLayer?

I need to transform QgsVectorLayers in python from one crs into another crs. By googling I found the following solution (https://qgis.readthedocs.org/en/latest/docs/pyqgis_developer_cookbook/05_crs.html), which works for points only:

crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84
crsDest = QgsCoordinateReferenceSystem(32633)  # WGS 84 / UTM zone 33N
xform = QgsCoordinateTransform(crsSrc, crsDest)
pt1 = xform.transform(QgsPoint(18,5))

Is there a way to make a crs transformation of an entire layer?

Making CRS transformation of QgsVectorLayer with PyQGIS

I need to transform QgsVectorLayers in PyQGIS from one CRS into another. By googling I found the following solution PyQGIS Developer Cookbook, which works for points only:

crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84
crsDest = QgsCoordinateReferenceSystem(32633)  # WGS 84 / UTM zone 33N
xform = QgsCoordinateTransform(crsSrc, crsDest)
pt1 = xform.transform(QgsPoint(18, 5))

Is there a way to make a CRS transformation of an entire layer?

Notice removed Improve details by bugmenot123
Bounty Ended with Vincent_v_E's answer chosen by bugmenot123
Tweeted twitter.com/StackGIS/status/902197005790928897
Notice added Improve details by bugmenot123
Bounty Started worth 250 reputation by bugmenot123
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Source Link
gallay
  • 361
  • 3
  • 15

How to make crs transformation of a QgsVectorLayer?

I need to transform QgsVectorLayers in python from one crs into another crs. By googling I found the following solution (https://qgis.readthedocs.org/en/latest/docs/pyqgis_developer_cookbook/05_crs.html), which works for points only:

crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84
crsDest = QgsCoordinateReferenceSystem(32633)  # WGS 84 / UTM zone 33N
xform = QgsCoordinateTransform(crsSrc, crsDest)
pt1 = xform.transform(QgsPoint(18,5))

Is there a way to make a crs transformation of an entire layer?