Global and project-level functions

iface.newProject

Start a blank project.

iface.addRasterLayer iface.addRasterLayer.RasterBrick iface.addRasterLayer.RasterLayer iface.addRasterLayer.RasterStack iface.addRasterLayer.list iface.addRasterLayer.default

Add a new raster layer to QGIS.

iface.addTileLayer

Add a new tile server raster layer to QGIS.

iface.addVectorLayer iface.addVectorLayer.geo_json iface.addVectorLayer.sf iface.addVectorLayer.list iface.addVectorLayer.default

Add a new vector layer to QGIS.

iface.defaultStyleSheetOptions

Return changeable options built from settings and/or defaults.

Map canvas functions

mapCanvas.center

Get map center, in geographical coordinates.

mapCanvas.crsTransformEnabled mapCanvas.setCrsTransformEnabled mapCanvas.crsTransformEnabled<-

Set whether on-the-fly reprojection is enabled or disabled.

mapCanvas.destinationCrs mapCanvas.setDestinationCrs

Get or set the map canvas' destination coordinate reference system.

mapCanvas.extent

Get the current zoom exent of the map canvas, in geographical coordinates.

mapCanvas.fullExtent

Get the combined exent for all layers on the map canvas, in geographical coordinates.

mapCanvas.layerCount

Return number of layers on the map that are set visible.

mapCanvas.magnificationFactor

Retrieve the magnification factor of the map canvas.

mapCanvas.mapSettings mapCanvas.mapSettings.xml

Retrieve configuration for rendering of the map.

mapCanvas.saveAsImage

Retrieve currently visible map canvas content.

mapCanvas.scale

Get the last reported scale of the canvas.

mapCanvas.setCenter

Set map center, in geographical coordinates.

mapCanvas.setExtent

Zoom to the given feature extent.

mapCanvas.zoomIn

Zoom in by a fixed factor.

mapCanvas.zoomOut

Zoom out by a fixed factor.

mapCanvas.zoomScale

Zoom to a specific scale.

mapCanvas.zoomToFullExtent

Zoom to the full extent of all layers.

mapCanvas.zoomToSelected

Zoom to the extent of the selected features of current (vector) layer.

Querying map layers shown on the map canvas

mapCanvas.layer

Retrieve information about a visible map layer.

mapCanvas.layers

Retrieve list of layers within map canvas that are set visible.

mapCanvas.layerCount

Return number of layers on the map that are set visible.

Querying the map layer registry

mapLayers

Returns information about all registered layers.

mapLayer

Retrieve information about a layer by id.

mapLayers.count

Returns the total number of registered layers (visible or not).

mapLayers.removeMapLayer

Remove a layer from the registry by layer ID.

Manipulating individual map layers

qgislayer

R object class representing a QGIS layer.

mapLayer

Retrieve information about a layer by id.

mapLayer.crs mapLayer.setCrs mapLayer.crs<-

Get or set the coordinate reference system for the given layer.

mapLayer.renderer mapLayer.setRenderer mapLayer.renderer<-

Retrieve or set a layer's feature or raster renderer in XML format.

mapLayer.style

Retrieve a layer's XML style element.

mapLayer.visible mapLayer.setVisible mapLayer.visible<-

Get or set a layer's visibility in the map canvas.

Accessing layer features

mapLayer.getFeatures

Return information about features of a vector layer.

mapLayer.selectedFeatureCount

Retrieve the number of features that are selected in a vector layer.

mapLayer.selectedFeatures

Return information about the currently selected features from a vector layer.

mapCanvas.zoomToSelected

Zoom to the extent of the selected features of current (vector) layer.

Processing

processing.alglist processing.alghelp processing.algoptions

Retrieve information about available processing algorithms.

processing.runalg

Run a processing algorithm on the given data.

Helper classes and functions

qgisCRS

Check or convert object to a QGIS-compatible CRS specification.

qgislayer

R object class representing a QGIS layer.

qgisxml qgisxml.all qgisxml<-

Access and set configuration fields of a QGIS configuration XML chunk.

Low-level package functions

qgisremote

Make a low-level call to a QGIS Network API.

qgisremote.options

Set or get QGIS Network API connection details for current session.