Graphics Reference
In-Depth Information
provider.addFeatures(features)
layer.updateExtents()
iface.mapCanvas().zoomToFullExtent()
Running this program from within QGIS will create a new memory-based map layer
named "Point Layer" with three features in it, which represent the location of three
famous towers in Western Europe:
To make this example useful, we would add symbols to draw the towers in a more mean-
ingful way, and probably also display the name and height as a label beside each point.
However, you can see how a memory layer can be used to create spatial data from within
your program and include it as a layer within the map.
Search WWH ::




Custom Search