Tag Info

New answers tagged

1

Have you tried adding the "(A)" before passing the output parameter to the algorithm? You would need to add 3 lines to the for loop in the run() method: for fname in glob.glob("*.shp"): pieces = list(os.path.splitext(fname)) pieces.insert(1,"(A)") nameWithA = "".join(pieces) outputs_1=general.runalg("qgis:clip", outputs_0['SAVENAME'], fname, ...


2

I would try deleting the feature attribute that corresponds to class_field (you can do it right before you call setAttributes()): del featAttr[class_field_index] and deleting the field from fields (you can do it before the loop, once you have instantiated both fields and class_field_index): fields.remove( class_field_index )


2

I assume your road_layer_i (for i in [0-99]) layers are not the same layer, that is, they do not have exactly the same lines. Having said that, I've modified your code snippet a bit, making these changes: Use QgsMapLayerRegistry.instance().mapLayers().values() instead of self.iface.mapCanvas().layers(). This ensures you'll iterate on all layers and not ...


1

The problem with your procedure is that you probably used two different Processing versions, v.2.2.0-2 on your computer and v.2.6 on the other computer. Since v.2.6, Processing comes as a core QGIS plugin. It is installed in /usr/share/qgis/python/plugins/ (C:\OSGeo4W64\apps\qgis\python\plugins on Windows) and not in ~/.qgis2/python/plugins/ ...


1

I managed to get the script to run by copying the processing folder from my computer and placing it in the .qgis2 of the other computer. It seems there's something missing in the other computer although I'm not sure what. I did notice that when I installed QGIS via the OSGeo4W installer, there were no plugin folders in \.qgis2\python\plugins\. They only ...


1

The initial path setting might be off. QgsApplication.setPrefixPath("C:\\OSGeo4W64\\apps\\qgis", True) Maybe try setting this path to a variable, then use the variable in the set path setPath = 'C:\OSGeo4W64\apps\qgis' QgsApplication.setPrefixPath(setPath, True) OR maybe this? QgsApplication.setPrefixPath(r'C:\OSGeo4W64\apps\qgis', True) I hope this ...



Top 50 recent answers are included