### Navigation

- index
- modules
- next
- previous
- Home »
- Contents »
- InaSAFE’s API documentation »
- Package::safe_qgis »

# Module: safe_qgis.qgis_interface

InaSAFE Disaster risk assessment tool developed by AusAid - QGIS plugin implementation.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Note

This source code was copied from the ‘postgis viewer’ application with original authors: Copyright (c) 2010 by Ivan Mincik, ivan.mincik@gista.sk Copyright (c) 2011 German Carrillo, geotux_tuxman@linuxmail.org

class `safe_qgis.qgis_interface.``QgisInterface`(canvas)

  Class to expose qgis objects and functionalities to plugins.

  This class is here for enabling us to run unit tests only, so most methods are simply stubs.

  `activeLayer`()

    Get pointer to the active layer (layer selected in the legend)

  `addDockWidget`(area, dockwidget)

    Add a dock widget to the main window

  `addLayer`(theLayer)

    Handle a layer being added to the registry so it shows up in canvas.

    Args:
      theLayers: list<QgsMapLayer> list of map layers that were added
    Returns:
      None
    Raises:
      None
  `addLayers`(theLayers)

    Handle layers being added to the registry so they show up in canvas.

    Args:
      theLayers: list<QgsMapLayer> list of map layers that were added
    Returns:
      None
    Raises:
      None
  `addRasterLayer`(rasterLayerPath, baseName)

    Add a raster layer given a raster layer file name

  `addToolBar`(name)

    Add toolbar with specified name

  `addToolBarIcon`(qAction)

    Add an icon to the plugins toolbar

  `addVectorLayer`(vectorLayerPath, baseName, providerKey)

    Add a vector layer

  `mainWindow`()

    Return a pointer to the main window

    In case of QGIS it returns an instance of QgisApp

  `mapCanvas`()

    Return a pointer to the map canvas

  `removeToolBarIcon`(qAction)

    Remove an action (icon) from the plugin toolbar

  `zoomFull`()

    Zoom to the map full extent

  `zoomToActiveLayer`()

    Zoom to extent of active layer

  `zoomToNext`()

    Zoom to next view extent

  `zoomToPrevious`()

    Zoom to previous view extent

This module forms part of the InaSAFE tool.

### Navigation

- index
- modules
- next
- previous
- Home »
- Contents »
- InaSAFE’s API documentation »
- Package::safe_qgis »