Hi! I want to load three layers into qgis (2.18) via python. 1 Vector Layer (boundary of my farm / fields) 2 Raster Layer ( band4 and band8 from sentinel satellite) Additionally I want to switch them to the same crs (4326). But if I do this, the field boundaries are not visible as overlay on the raster layers... I need to zoom out (quite a lot) and my boundaries are somewhere else in qgis.
Some a hint for me? Here my example code.. import processing from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.analysis import * fullPathFeldgrenzen = "Path/to/fields.shp" fullPathBand4 = "Path/to/Band4/B04.jp2" fullPathBand8 = "Path/to/Band8/B08.jp2" fieldBoundary = iface.addVectorLayer(fullPathFeldgrenzen, 'fieldBoundary', 'ogr') tmp = iface.activeLayer() crs = tmp.crs() crs.createFromId(4326) tmp.setCrs(crs) band4 = iface.addRasterLayer(fullPathBand4, 'band4') tmp = iface.activeLayer() crs = tmp.crs() crs.createFromId(4326) tmp.setCrs(crs) band8 = iface.addRasterLayer(fullPathBand8, 'band8') tmp = iface.activeLayer() crs = tmp.crs() crs.createFromId(4326) tmp.setCrs(crs)
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
