0

Why the processing algorithms run just with input files located in QGIS desktop? Is there any way to work with directories?

I am developing a plugin and I am using processing algorithms but the number of input files doesn't give the possibility to work in QGIS desktop. Is there any way to work with directories?

closed as too broad by PolyGeo Jun 2 '18 at 9:47

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1

I don't really get what you mean by "Desktop" ? If you can select files as input the user can choose to load sth. from the Desktop in Windows as well. For Directories: You could enable the option for users to load a custom folder as string parameter:

self.addParameter(ParameterString(self.DIR, 'Lookup Directory','C:/' ))

In any simple script you can use

##directory=folder
  • 1
    I think he/she is talking about QGIS Desktop. The processing algorithms usually work with layers that are loaded in QGIS. – AndreJ May 8 '14 at 10:59
  • Yes. I am talking about QGIS desktop. I am trouble to run processing algorithms in python script because I have as input file a hdf file (modis image). My code to call processing algorithm is: Processing.runAlgorithm("gdalogr:cliprasterbyextent", None, raster_path, None, "x_min, x_max, y_min, y_max", None, out_clip_ndvi). The raster_path is a hdf file. But it gives me an error because a hdf file have several datasets but I don't know how to input them. – user27513 May 8 '14 at 11:09
  • You could use gdal_translate to extract them temporarily: gis.stackexchange.com/questions/90352/… – AndreJ May 8 '14 at 11:51
  • @user27513: Then you should edit your question (especially the title). The answer to your question does not depend on processing, but on your raster datatype and the way gdal works – Curlew May 8 '14 at 12:21
  • How I can use gdal_translate in a plugin implementation? I see the gis.stackexchange.com/questions/90352/… answer, and I try but I still have not convert hdf to tiff. – user27513 May 8 '14 at 14:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.