Say we have equally distributed x,y mesh vector file. Each coordinate has a map-unit based diameter circle symbology. If we zoom into a region of the map canvas far enough, some centroids exist outside of the map canvas view, thus they will not be displayed.
Is there any means to set a buffer surrounding the map canvas extents equal to the map-circle symbol diameters to prevent border coordinates from being omitted from render?
(yellow highlighted region in image attached image below)
Furthermore, implementing such into a pyqgis plugin?
(Hopefully) creating such a buffer would ensure coordinates just outside the map-view would still maintain symbol display.
The following snip was an (unsuccessful) adhoc test. Likely as I am improperly using the QgsRenderContext() Class?
(init method) .... self.cellDim=None self.iface.mapCanvas().extentsChanged.connect(self.updateMapBuffer) .... def updateMapBuffer(self): try: if self.cellDem==None: self.aquireGridDim() xMinBuffer = self.iface.mapCanvas().extent().xMinimum()-(self.cellDim*10) xMaxBuffer = self.iface.mapCanvas().extent().xMaximum()+(self.cellDim*10) yMinBuffer = self.iface.mapCanvas().extent().yMinimum()-(self.cellDim*10) yMaxBuffer = self.iface.mapCanvas().extent().yMaximum()+(self.cellDim*10) newExtent = QgsRectangle(xMinBuffer,yMinBuffer,xMaxBuffer,yMaxBuffer) QgsRenderContext().setExtent(newExtent) except AttributeError: pass
Probably also important to note - this test gives miniDumps and subsequent QGIS crash 9/10 times when opening. Obviously not the proper means.