1

My friend and I, we are developing a plugin for qgis but we have a drawback when doing the multibuffer we do not understand the methods well and the code we are using is the following

#Generación de los buffer sobre la capa vías # Se leen los vectores que esten el la lista de capas cargada en QGis layers = self.iface.legendInterface().layers()

    # Selecciona la capa vial para hacer multibuffer (capa de vías)
    selectedLayerIndex = self.dlg.capavias.currentIndex()
    selectedLayer = layers[selectedLayerIndex]

    # Generar el buffer de la capa vias
    vias = selectedLayer

    QgsGeometryAnalyzer().buffer(vias, "C:/Users/toshiba/Downloads/buffer_vias100.shp", 100, False, True, -1)
    QgsGeometryAnalyzer().buffer(vias, "C:/Users/toshiba/Downloads/buffer_vias200.shp", 200, False, True, -1)
    QgsGeometryAnalyzer().buffer(vias, "C:/Users/toshiba/Downloads/buffer_vias300.shp", 300, False, True, -1)
    QgsGeometryAnalyzer().buffer(vias, "C:/Users/toshiba/Downloads/buffer_vias400.shp", 400, False, True, -1)
    QgsGeometryAnalyzer().buffer(vias, "C:/Users/toshiba/Downloads/buffer_vias500.shp", 500, False, True, -1)
    buffer_vias500 = iface.addVectorLayer("C:/Users/toshiba/Downloads/buffer_vias500.shp", "", "ogr")
    buffer_vias400 = iface.addVectorLayer("C:/Users/toshiba/Downloads/buffer_vias400.shp", "", "ogr")
    buffer_vias300 = iface.addVectorLayer("C:/Users/toshiba/Downloads/buffer_vias300.shp", "", "ogr")
    buffer_vias200 = iface.addVectorLayer("C:/Users/toshiba/Downloads/buffer_vias200.shp", "", "ogr")
    buffer_vias100 = iface.addVectorLayer("C:/Users/toshiba/Downloads/buffer_vias100.shp", "", "ogr")
aleho
  • 510
  • 2
  • 10
  • Did you check the API? Actually it explains everything: http://qgis.org/api/1.6/classQgsGeometryAnalyzer.html#48d71b239adcd51a241d8c96fcf0bf26

    Is there a specific parameter or problem?

    – aleho Oct 13 '17 at 07:16

0 Answers0