Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#164 experimental python export from SAGA garbles variables for CHannel Network

v2.1.0
open
Olaf Conrad
python (1)
1
2013-07-02
2013-07-02
Reuter
No

Reproduction:
1) Right mouse click on "Channel Network" in "Terrain Analysis-Channels", save as python script.

2) extract from python script with errors:
else:
ingrid = saga_api.SG_Create_Grid(saga_api.CSG_String(sys.argv[1]))
out_grid = saga_api.SG_Create_Grid(grid_in.Get_System())
in
shapes = saga_api.SG_Create_Shapes(saga_api.CSG_String(sys.argv[3]))
out_shapes = saga_api.SG_Create_Shapes()

    if Call_SAGA_Module(in__grid, out_grid, in__shapes, out_shapes) != 0:
        grid_out  .Save(saga_api.CSG_String(sys.argv[2]))
        shapes_out.Save(saga_api.CSG_String(sys.argv[4]))

3) Following errors:
ingrid and inshapes: - double underscore - is that a SAGA-GIS convention ?
in__grid -> in grid_in : name part swap for Get_System call
out_shape -> shapes_out: name part swap for save call
grid_out .Save : extra white-space in OOP is usually not so functional.

Discussion

  • Reuter
    Reuter
    2013-07-02

    on a related issue: suggestion to rename the "def Call_SAGA_Module(xxxx" with something related to the command/library/tool called e.g. for above example rename:
    "def Call_SAGA_Module" into "def TerrainAnalysis-Channels" ?

     


Anonymous


Cancel   Add attachments