Back to Nutria ¦ Start Page

Convert Multiple SDC Via Nutria Function

HydroVish.inc


 
    # Define a gmake function to encode paths in URL format
    space=${} # defining a space
    encode=$(subst $(space),+,$(subst :,%3A,$(subst /,%2F,$(1))))

    HydroVish=QUERY_STRING="$(call encode,$1&Action=Process)" ../../../bin/win64/HydroVish.exe

    # Defining a make function to convert SDC files to F5
    # Parameters:
    #     $1 .... gridname
    SDCtoF5=$(call HydroVish,InputFiles=$<&Nutrition::gridname=$(gridname)&Output Folder=$(abspath $(dir $@))&Nutrition=SDC to F5)

    export REQUEST_METHOD=GET
    

HydroVish.rules



    # Pattern Rules to convert each SDC file, setting the QUERY_STRING environment variable as part of the rule
    %.f5: $(InputDir)/%.sdc
      $(call SDCtoF5,$(gridname))

    clean:
      $(RM) *.f5    
    

Makefile


 
    InputDir=C:/Users/$(USERNAME)/AirborneHydroMapping/HydroVish/data/SampleData/FWF

    gridname=TestData

    # Defining a result that depends on two rules - this allows for parallelization via make -j !
    # This is the only place where the filenames need to be specified!
    Result: 190209_124217_Scanner_1_0.f5 190209_124217_Scanner_1_1.f5

    # Placing function definitions in its own include file
    include HydroVish.inc

    # Also placing rules in its own include file,
    # all of those rules are project-independent
    include HydroVish.rules

    


Back to Nutria ¦ Start Page