def getMemLayer(self):
     """When restoring a project, the layer will already exist, so we shouldn't
      create a new one"""
     name = "interpolated_points_for_{}".format(self.layer.id())
     if not qgs.doesLayerNameExist(name): #FIXME this will not work if the user renames the memory layer
         memLayer = QgsVectorLayer("Point?crs=epsg:4326&index=yes",name, "memory")
     else:
         memLayer = qgs.getLayerFromLayerName(name)
     return memLayer
Exemplo n.º 2
0
 def getMemLayer(self):
     """When restoring a project, the layer will already exist, so we shouldn't
      create a new one"""
     name = "interpolated_points_for_{}".format(self.layer.id())
     if not qgs.doesLayerNameExist(
             name):  # FIXME this will not work if the user renames the memory layer
         memLayer = QgsVectorLayer("Point?crs=epsg:4326&index=yes", name, "memory")
     else:
         memLayer = qgs.getLayerFromLayerName(name)
     return memLayer