1

I want to use saga_cmd to select from a shapefile only the shapes, which have a certain area size and store this selection into a new shapefile. I'm using the following command to filter via the respective area size:

    saga_cmd shapes_tools 3 -SHAPES=objects_8_area.shp -FIELD=AREA -EXPRESSION=a > 5.0 -METHOD=0 saga_cmd

However, it seems that SAGA is not working - means there is no output on the cmd.

Does anyone of you have an idea what the problem might be?

After the selection will work, I would like to store the selection in a new shapefile with:

    saga_cmd shapes_tools 6 -INPUT=objects.shp -OUTPUT=objects_red.shp

Or could anyone of you suggest another workaround?


I got a solution in another forum.

https://sourceforge.net/p/saga-gis/discussion/790705/thread/b9a1d1ae/

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Marcus
  • 11
  • 3
  • When you manually enter "saga_cmd", from cmd window, do you see a message? You may need to add the saga_cmd path to the PATH environment variable. Or provide the full saga_cmd path in the script. – klewis Sep 28 '16 at 21:03
  • Script tutorial - https://sourceforge.net/projects/saga-gis/files/SAGA%20-%20Documentation/Tutorials/Command_Line_Scripting/ – klewis Sep 28 '16 at 21:09
  • Hi klewis, thanks for your response. I already added the path to the environmental variable and calculated some more commands of saga_cmd succesfully. Should have mention this in the first post. Sorry! If I use "<" instead of ">", then Saga starts but do not find any results. However, there are values from about 0.2 up to 200m² in the field area. I already tried different settings, but without any result which might be the right one. Also checked manually in the GUI. – Marcus Sep 29 '16 at 06:59

0 Answers0