New answers tagged scripting
When you created your script tool you would have gone through that wizard to wire up your script to a tool interface. At the stage where you point it to the script python file (.py) there is a check box which is usually un-ticked which is Show command window when executing script, try ticking that on?
For a pure python solution, you can use os.path.isfile to check if the shapefile exists and is indeed a file. import os myfile = r'C:\temp\myshp.shp' if os.path.isfile(myfile): print "The file exists" # Do something
You may use geoconfig python module: gsconfig is a python library for manipulating a GeoServer instance via the GeoServer RESTConfig API. Documentation Here is a similar Q/A that may help too: Python Geoserver gsconfig create resource from Postgis store table
You can (ab-)use the TimeManager plugin for this by making it output each frame of its animation as image. If your data has no time values, just fake them by incrementing an integer.
Virtual Fields are saved in the project, not in the layer itself. Shapefiles do not know the concept of virtual layers, only QGIS (projects) do. If you dynamically load a layer like in the sample code you pasted, there is no project involved and hence no virtual field specification loaded. You can check with the following code that there is no Field_2: ...
Top 50 recent answers are included