1

I'm writing a plugin which will create a new virtual layer containing points. I know the CRS of the new layer, as it is the same as the layer I am using for input. I would like to specify the CRS in code but the CRS selector dialog pops up when I create the layer. I would like to suppress that dialog so that something like this will work.

def createVirtualLayer(self):
    self.vl = QgsVectorLayer("Point","block_labels", "memory")
    self.vl.setCrs(self.layer.crs())
marcp
  • 895
  • 10
  • 21

0 Answers0