Ignore:
Timestamp:
Mar 28, 2019, 11:31:26 PM (6 years ago)
Author:
djay
Message:

Add support for SAGA-GIS 7.2.0

Location:
branches/prototype-v0/zoo-project/zoo-kernel
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/ZOOMakefile.opts.in

    r873 r900  
    8080MS_FILE=@MS_FILE@
    8181
    82 ZOO_CFLAGS=@GETTEXT_CFLAGS@ -I${ZRPATH}/../thirds/cgic206/ -I${ZRPATH}/zoo-kernel/
    83 ZOO_LDFLAGS=@GETTEXT_LDFLAGS@ @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@
     82ZOO_CFLAGS=-I${ZRPATH}/../thirds/cgic206/ -I${ZRPATH}/zoo-kernel/
     83ZOO_LDFLAGS=@OPENSSL_LDFLAGS@ @UUID_LDFLAGS@
    8484
    8585JAVACFLAGS=@JAVA_CPPFLAGS@
     
    119119MONO_FILE=@MONO_FILE@
    120120
    121 CFLAGS=@SSH2_CPPFLAGS@ @GETTEXT_CFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
    122 LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @GETTEXT_LDFLAGS@ @JSON_LDFLAGS@ @XSLT_LDFLAGS@
     121CFLAGS=@SSH2_CPPFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
     122LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS}  ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @JSON_LDFLAGS@ @XSLT_LDFLAGS@
    123123
    124124DATAROOTDIR=@datarootdir@/zoo-project
  • branches/prototype-v0/zoo-project/zoo-kernel/configure.ac

    r877 r900  
    114114#============================================================================
    115115
    116 AC_ARG_WITH([gettext],
    117     [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])],
    118     [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"])
    119 
    120 GETTEXT_CFLAGS="-I$GETTEXT_DIR/include"
    121 GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl"
     116#AC_ARG_WITH([gettext],
     117#    [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])],
     118#    [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"])
     119
     120#GETTEXT_CFLAGS="-I$GETTEXT_DIR/include"
     121#GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl"
    122122#CFLAGS_SAVE="$CFLAGS"
    123123#CFLAGS="$GETTEXT_CFLAGS"
     
    127127#AC_CHECK_LIB(intl,
    128128#                       [dgettext], [] , [AC_MSG_ERROR([could not find $i function in gettext library])])
    129 AC_SUBST([GETTEXT_CFLAGS])
    130 AC_SUBST([GETTEXT_LDFLAGS])
     129#AC_SUBST([GETTEXT_CFLAGS])
     130#AC_SUBST([GETTEXT_LDFLAGS])
    131131
    132132#============================================================================
     
    10491049        [SAGAPATH="$withval"], [SAGAPATH=""])
    10501050
     1051AC_ARG_WITH([saga-version],
     1052        [AS_HELP_STRING([--with-saga-version=VERSION], [Specifies the SAGA-GIS version number])],
     1053        [SAGAVERS="$withval"], [SAGAVERS="2"])
     1054
    10511055if test -z "$SAGAPATH"
    10521056then
     
    10641068        WX_ISSUE="-D_WX_WXCRTVARARG_H_"
    10651069        SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\""
    1066         SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
     1070        SAGA_CPPFLAGS="-DSAGA_VERSION=${SAGAVERS} -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
    10671071        SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api"
    10681072        SAGA_ENABLED="-DUSE_SAGA"
     
    10751079        LIBS_SAVE="$LIBS"
    10761080        LIBS="$SAGA_LDFLAGS"
    1077         AC_CHECK_HEADERS([module_library.h],
    1078                         [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
    1079         AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])],
    1080                 [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])])
     1081        if test "$SAGAVERS" == "2"; then
     1082        AC_CHECK_HEADERS([module_library.h],
     1083                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
     1084        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])],
     1085                [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])])
     1086        else
     1087        AC_CHECK_HEADERS([tool_library.h],
     1088                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
     1089        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "tool_library.h"],[SG_Get_Tool_Library_Manager();]])],
     1090                [AC_MSG_RESULT([checking for SG_Get_Tool_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Tool_Library_Manager... failed])])
     1091        fi
     1092       
    10811093        LIBS="$LIBS_SAVE"
    10821094        AC_LANG_POP([C++])
  • branches/prototype-v0/zoo-project/zoo-kernel/response_print.h

    r899 r900  
    8181#ifndef WIN32
    8282//#include <locale.h>
    83 #include <xlocale.h> // knut: this appears to be a non-standard header file that has been removed in newer versions of glibc; it may be sufficient to include <locale.h> (see above)
     83#include <locale.h> // knut: this appears to be a non-standard header file that has been removed in newer versions of glibc; it may be sufficient to include <locale.h> (see above)
    8484#endif
    8585#include "ulinet.h"
  • branches/prototype-v0/zoo-project/zoo-kernel/service.c

    r899 r900  
    2525#include "service.h"
    2626
    27  // knut: time utilities required for new log function (logMessage)
     27// knut: time utilities required for new log function (logMessage)
    2828#include <ctime>
    2929#include <chrono>
  • branches/prototype-v0/zoo-project/zoo-kernel/service_internal.h

    r899 r900  
    8181#endif
    8282#ifndef WIN32
    83 #include <xlocale.h>
     83#include <locale.h>
    8484#endif
    8585
  • branches/prototype-v0/zoo-project/zoo-kernel/service_internal_saga.c

    r790 r900  
    3030#include <api_core.h>
    3131#include <data_manager.h>
    32 #include <module_library.h>
     32#include <saga_api.h>
    3333#define _ZOO_SAGA
    3434#include "service_internal_saga.h"
     
    237237        return false;
    238238      }
    239       return( param->Set_Value(SG_Get_Data_Manager().Find(&fileName)) );
     239      fprintf(stderr,"%s %s\n",carg->name,carg->value);
     240      fflush(stderr);
     241      return( param->Set_Value(SG_Get_Data_Manager().Find(&fileName,false)) );
    240242    }
    241243    else
     
    250252            SG_Get_Data_Manager().Add(&fileName);
    251253          }
    252           param->asList()->Add_Item(SG_Get_Data_Manager().Find(&fileName));
     254          param->asList()->Add_Item(SG_Get_Data_Manager().Find(&fileName,false));
    253255        }
    254256      }
     
    327329            inmap=getMap(argument,(CSG_String(param->Get_Identifier())+"_MIN").b_str());
    328330            if(inmap!=NULL)
     331#if SAGA_MAJOR_VERSION == 2           
    329332              param->asRange()->Set_LoVal(strtod(inmap->value,NULL));
     333#else
     334              param->asRange()->Set_Min(strtod(inmap->value,NULL));
     335#endif     
    330336            inmap=getMap(argument,(CSG_String(param->Get_Identifier())+"_MAX").b_str());
    331337            if(inmap!=NULL)
     338#if SAGA_MAJOR_VERSION == 2           
    332339              param->asRange()->Set_HiVal(strtod(inmap->value,NULL));       
     340#else
     341              param->asRange()->Set_Max(strtod(inmap->value,NULL));
     342#endif     
    333343          }
    334344          if(inmap==NULL){
     
    386396            else if( param->is_DataObject_List() )
    387397              {
    388                 for(int i=0; i<param->asList()->Get_Count(); i++)
     398                for(int i=0; i<
     399#if SAGA_MAJOR_VERSION == 2
     400                      param->asList()->Get_Count()
     401#else
     402                      param->asList()->Get_Data_Count()
     403#endif               
     404                      ; i++)
    389405                  {
    390                     CSG_Data_Object *pObject = param->asList()->asDataObject(i);
     406                    CSG_Data_Object *pObject =
     407#if SAGA_MAJOR_VERSION == 2                   
     408                      param->asList()->asDataObject(i)
     409#else
     410                      param->asList()->Get_Data(i)
     411#endif               
     412                      ;
    391413                   
    392414                    if( pObject->is_Modified() && SG_File_Exists(pObject->Get_File_Name()) )
     
    439461                        }
    440462                    }
    441                  
     463#if SAGA_MAJOR_VERSION == 2               
    442464                  int nFileNames = param->asList()->Get_Count() <= fileNames.Get_Count() ? fileNames.Get_Count() : fileNames.Get_Count() - 1;
    443465                  for(int i=0; i<param->asList()->Get_Count(); i++)
     
    458480                                  CSG_String(param->asList()->asDataObject(i)->Get_File_Name()).b_str());
    459481                    }
     482#else
     483                  int nFileNames = param->asList()->Get_Data_Count() <= fileNames.Get_Count() ? fileNames.Get_Count() : fileNames.Get_Count() - 1;
     484                  for(int i=0; i<param->asList()->Get_Data_Count(); i++)
     485                    {
     486                      if( i < nFileNames )
     487                        {
     488                          param->asList()->Get_Data(i)->Save(fileNames[i]);
     489                        }
     490                      else
     491                        {
     492                          param->asList()->Get_Data(i)->Save(CSG_String::Format(SG_T("%s_%0*d"),
     493                                                                                    fileNames[fileNames.Get_Count() - 1].c_str(),
     494                                                                                    SG_Get_Digit_Count(param->asList()->Get_Data_Count()),
     495                                                                                    1 + i - nFileNames
     496                                                                                    ));
     497                        }
     498                      setMapArray(cMaps->content,"generated_file",i,
     499                                  CSG_String(param->asList()->Get_Data(i)->Get_File_Name()).b_str());
     500                    }
     501                 
     502#endif           
    460503                }
    461504            }
     
    477520  int res=SERVICE_FAILED;
    478521
     522#if SAGA_MAJOR_VERSION == 2 
    479523  CSG_Module_Library * library=SG_Get_Module_Library_Manager().Get_Library(CSG_String(lib_name),true);
     524#else
     525  CSG_Tool_Library * library=SG_Get_Tool_Library_Manager().Get_Library(CSG_String(lib_name),true);
     526#endif 
    480527  if( library == NULL){
    481528    char tmp[255];
     
    486533  }
    487534
     535#if SAGA_MAJOR_VERSION == 2 
    488536  CSG_Module * module=library->Get_Module(atoi(module_name));
     537#else
     538  CSG_Tool * module=library->Get_Tool(atoi(module_name));
     539#endif 
    489540  if(module == NULL){
    490541    char tmp[255];
     
    9851036  SG_Set_UI_Callback(Get_Callback(watcher));
    9861037
     1038#if SAGA_MAJOR_VERSION == 2 
    9871039  int n = SG_Get_Module_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false);
    988   if( SG_Get_Module_Library_Manager().Get_Count() <= 0 ){
     1040  if( SG_Get_Module_Library_Manager().Get_Count() <= 0 )
     1041#else
     1042  int n = SG_Get_Tool_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false);
     1043  if( SG_Get_Tool_Library_Manager().Get_Count() <= 0 )
     1044#endif
     1045  {
    9891046    setMapInMaps(*main_conf,"lenv","message","Could not load any SAGA tool library");
    9901047    res=SERVICE_FAILED;
     
    9951052
    9961053  // Load the SAGA-GIS library corresponding to the serviceProvider
     1054#if SAGA_MAJOR_VERSION == 2 
    9971055  CSG_Module_Library * library=SG_Get_Module_Library_Manager().Get_Library(CSG_String(serviceProvider->value),true);
     1056#else
     1057  CSG_Tool_Library * library=SG_Get_Tool_Library_Manager().Get_Library(CSG_String(serviceProvider->value),true);
     1058#endif
    9981059  if( library == NULL){
    9991060    char tmp[255];
     
    10051066 
    10061067  // Load the SAGA-GIS module corresponding to the service name from the library
     1068#if SAGA_MAJOR_VERSION == 2 
    10071069  CSG_Module * module=library->Get_Module(atoi(s->name));
     1070#else
     1071  CSG_Tool * module=library->Get_Tool(atoi(s->name));
     1072#endif
    10081073  if(module == NULL){
    10091074    char tmp[255];
     
    10171082  // Load all the parameters defined for the module
    10181083  CSG_Parameters * params=module->Get_Parameters();
    1019   int pc=params->Get_Count();
    10201084  if(!params){
    10211085    char tmp[255];
     
    10261090    return res;
    10271091  }
     1092  int pc=params->Get_Count();
    10281093
    10291094  // Loop over each inputs to transform raster files to grid when needed,
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png