1

I have to classify land cover/change every 2 months. Every 2 months about 5000 random selected points are classified, using L7/L8 images. For this, images from 5 different dates are show, side-by-side. Its enough if a can see a 'minitile' of the region around the selected point (1:30.000 scale).

I can do this using ENVI software, but I want to know if I can do this in QGIS. There is a plugin for this or I'll have to figure one out?

  • Is the goal just to visualize the already classified images, or do you also want to run the classification in QGIS? With the SAGA process "cluster analysis for grids" in QGIS you can run an unsupervised classification. SAGA does also have the process "supervised classification". I do however prefer the SCP plugin for the supervised classification in QGIS. Check out the GRASS plugin as well. If the main goal is to classify the images consider to use the dedicated RS software from GRASS (open source) instead of QGIS. – Chris Mar 30 '15 at 11:38
  • No, the goal is just to visualize a group of random points. The methodology implies that the classification will made by the interpreter. So, the plugin will help the interpreter to doing this. – wfoschiera Mar 31 '15 at 14:25
3

There is a Dockable MirrorMap plugin which allows multiple canvas windows to be open. Once downloaded and installed, you can click the icon multiple times to create multiple windows although it might get a bit cluttered the more you add:

Dockable MirrorMap

Hope this helps!

1

If it is just for visualizing you could use the Print Composer with five map frames. A print layout can contain multiple map frames, and each can display different layers, so you could add all five images to the map canvas and then create one map frame for each in the print canvas, enabling only one image layer for each.

  • I think the robot is a bit aggressive on one-liners... – Jakob Mar 27 '15 at 14:03
  • does this one-liner explain to wfoschiera how to use composer and why it will solve his question? Also a sentence with why not in it is really a question not an answer. – Brad Nesom Mar 27 '15 at 14:36
  • There is no robot (that I know of). Your answer was flagged by one or more people, and as a result of voting or mod action the notification was placed. As Brad points out, even without the punctuation the answer read as a question and something more suitable as a comment. However I do agree that lately there as been an increase in the number of flagged answers that could just as easily have been edited a little for improvement rather than flagged since the flag even says it's only for 'content unlikely salvageable through editing'. – Chris W Mar 27 '15 at 17:40
  • One-lines or not, it not solve my problem. Sorry dude, but I need something less flexible (yep, it need to be very, very concise every time that someone will work with that). Think if every time a print composer has to be formatted to show the point area (it 5000 points per period). Thanks for your help. – wfoschiera Mar 28 '15 at 13:18
1

You can also use a small Python script reworked after http://docs.qgis.org/2.6/en/docs/pyqgis_developer_cookbook/canvas.html (note QString is not used anymore, the doc needs an update)

# Open a new map window with selected layer and three navigation tools
# Run as below in pyqgis console in qgis
# >>> import mywnd
# >>> w1 = mywnd.MyWnd("MyLayername1")
# >>> w1.show()
# >>> w2 = mywnd.MyWnd("MyLayername2")
# >>> w2.show()
#....
from qgis.gui import *
from qgis.core import *
from PyQt4.QtGui import QAction, QMainWindow
from PyQt4.QtCore import SIGNAL, Qt

class MyWnd(QMainWindow):
  def __init__(self, layername):
    QMainWindow.__init__(self)

    layer = QgsMapLayerRegistry.instance().mapLayersByName(layername)[0]

    self.canvas = QgsMapCanvas()
    self.canvas.setCanvasColor(Qt.white)

    self.canvas.setExtent(layer.extent())
    self.canvas.setLayerSet( [ QgsMapCanvasLayer(layer) ] )

    self.setCentralWidget(self.canvas)

    actionZoomIn = QAction("Zoom in", self)
    actionZoomOut = QAction("Zoom out", self)
    actionPan = QAction("Pan", self)

    actionZoomIn.setCheckable(True)
    actionZoomOut.setCheckable(True)
    actionPan.setCheckable(True)

    self.connect(actionZoomIn, SIGNAL("triggered()"), self.zoomIn)
    self.connect(actionZoomOut, SIGNAL("triggered()"), self.zoomOut)
    self.connect(actionPan, SIGNAL("triggered()"), self.pan)

    self.toolbar = self.addToolBar("Canvas actions")
    self.toolbar.addAction(actionZoomIn)
    self.toolbar.addAction(actionZoomOut)
    self.toolbar.addAction(actionPan)

    # create the map tools
    self.toolPan = QgsMapToolPan(self.canvas)
    self.toolPan.setAction(actionPan)
    self.toolZoomIn = QgsMapToolZoom(self.canvas, False) # false = in
    self.toolZoomIn.setAction(actionZoomIn)
    self.toolZoomOut = QgsMapToolZoom(self.canvas, True) # true = out
    self.toolZoomOut.setAction(actionZoomOut)

    self.pan()

  def zoomIn(self):
    self.canvas.setMapTool(self.toolZoomIn)

  def zoomOut(self):
    self.canvas.setMapTool(self.toolZoomOut)

  def pan(self):
    self.canvas.setMapTool(self.toolPan)

Then from the Python script console run:

import mywnd
w1 = mywnd.MyWnd("MyLayername1")
w1.show()
w2 = mywnd.MyWnd("MyLayername2")
w2.show()
#etc......

If you make changes to the mywnd.py you can reload it with:

reload(mywnd)
  • Thank you @Jakob. These lines will help me a lot, I'll probably make a plugin and insert more parameters. Thank you, again. – wfoschiera Mar 28 '15 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.