I wanted to know how qgis reads shapefile. Like i have choose any shapefile from qgis dialog then what are the steps that qgis take to read and render this shapefile data. Wrather it reads full shapefile data into memory or it opens file connection and reads and renders at runtime?
So far i have found this
layer = QgsVectorLayer(path, name, provider) if not layer.isValid(): raise IOError, "Failed to open the layer" # add layer to the registry QgsMapLayerRegistry.instance().addMapLayer(layer) # set extent to the extent of our layer canvas.setExtent(layer.extent()) # set the map canvas layer set canvas.setLayerSet([QgsMapCanvasLayer(layer)])
I have opened documentation of each function but i am not successfull in understanding flow of how it is reading shapefile