Changeset 775 for trunk


Ignore:
Timestamp:
Jun 14, 2016, 11:17:20 AM (9 years ago)
Author:
djay
Message:

Add GDAL 2 support to the cgal services. Updadte otb support to build against OTB 5.4.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/thirds/otb2zcfg/CMakeLists.txt

    r550 r775  
    1212 
    1313ADD_EXECUTABLE(otb2zcfg otb2zcfg.cxx ) 
    14 TARGET_LINK_LIBRARIES(otb2zcfg OTBCommon OTBApplicationEngine OTBIO ${ITK_LIBRARIES})
     14TARGET_LINK_LIBRARIES(otb2zcfg OTBCommon OTBApplicationEngine OTBImageIO ${ITK_LIBRARIES})
  • trunk/zoo-project/zoo-kernel/configure.ac

    r767 r775  
    334334# Check headers file
    335335CPPFLAGS_SAVE="$CPPFLAGS"
     336CGAL_CPPFLAGS="-I$CGALPATH/include"
    336337CPPFLAGS="$CGAL_CPPFLAGS"
    337338AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h],
     
    725726        [OTBPATH="$withval"], [OTBPATH=""])
    726727
     728AC_ARG_WITH([otb-version],
     729        [AS_HELP_STRING([--with-otb-version=PATH], [Specifies an alternative location for the otb library])],
     730        [OTBVERS="$withval"], [OTBVERS=""])
     731
    727732if test -z "$OTBPATH"
    728733then
     
    737742        fi
    738743        OTB_ENABLED="-DUSE_OTB"
    739         OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkdouble-conversion-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS -litkzlib-$ITKVERS"
    740         OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS"
     744        if test -a "${OTBPATH}/include/OTB-${OTBVERS}" ; then
     745                OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/"
     746                OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS"
     747                OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS "
     748        else
     749                OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS"
     750                OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkdouble-conversion-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS -litkzlib-$ITKVERS"
     751
     752        fi
    741753        OTB_FILE="otbZooWatcher.o service_internal_otb.o"
    742754       
     
    747759        LDFLAGS_SAVE="$LDFLAGS"
    748760        LIBS="$LIBS_SAVE $OTB_LDFLAGS"
    749         AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
    750                         [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
    751         AC_LANG_POP([C++])
    752         AC_LANG(C++)
     761        echo $OTB_CPPFLAGS
     762        #AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
     763        #               [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
    753764        LDFLAGS_SAVE="$LDFLAGS"
    754765        LDFLAGS="$OTB_LDFLAGS"
     766        echo $OTB_LDFLAGS
    755767        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"],[std::vector<std::string> list = otb::Wrapwper::ApplicationRegistry::GetAvailableApplication();]])],
    756768                [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])])
    757769        LDFLAGS="$LDFLAGS_SAVE"
     770        AC_LANG_POP([C++])
     771        AC_LANG(C++)
    758772                       
    759773fi
  • trunk/zoo-project/zoo-services/cgal/cgal_service.c

    r469 r775  
    2929  VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE);
    3030  VSIFCloseL(ifile);
     31#if GDAL_VERSION_MAJOR >= 2
     32  GDALDataset *ipoDS =
     33    (GDALDataset*) GDALOpenEx( filename,
     34                               GDAL_OF_READONLY | GDAL_OF_VECTOR,
     35                               NULL, NULL, NULL );
     36#else
    3137  OGRDataSource* ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE);
     38#endif
    3239  if( ipoDS == NULL )
    3340    {
     41#if GDAL_VERSION_MAJOR >= 2
     42      GDALDriverManager* poR=GetGDALDriverManager();
     43#else
    3444      OGRSFDriverRegistrar    *poR = OGRSFDriverRegistrar::GetRegistrar();
     45#endif
    3546     
    3647      fprintf( stderr, "FAILURE:\n"
     
    4051      for( int iDriver = 0; iDriver < poR->GetDriverCount(); iDriver++ )
    4152        {
    42           fprintf( stderr, "  -> %s\n", poR->GetDriver(iDriver)->GetName() );
     53#if GDAL_VERSION_MAJOR >= 2
     54            fprintf( stderr, "  -> %s\n", poR->GetDriver(iDriver)->GetDescription() );
     55#else
     56            fprintf( stderr, "  -> %s\n", poR->GetDriver(iDriver)->GetName() );
     57#endif
    4358        }
    4459      char tmp[1024];
  • trunk/zoo-project/zoo-services/cgal/delaunay.c

    r546 r775  
    5050    /*      Try opening the output datasource as an existing, writable      */
    5151    /* -------------------------------------------------------------------- */
    52     OGRDataSource       *poODS;
    53    
     52#if GDAL_VERSION_MAJOR >= 2
     53    GDALDataset *poODS;
     54    GDALDriverManager* poR=GetGDALDriverManager();
     55    GDALDriver          *poDriver = NULL;
     56#else
     57    OGRDataSource       *poODS;   
    5458    OGRSFDriverRegistrar *poR = OGRSFDriverRegistrar::GetRegistrar();
    5559    OGRSFDriver          *poDriver = NULL;
     60#endif
    5661    int                  iDriver;
    57 
    5862    map *tmpMap=getMapFromMaps(outputs,"Result","mimeType");
    5963    const char *oDriver;
     
    7074      {
    7175#ifdef DEBUG
     76#if GDAL_VERSION_MAJOR >= 2
     77        fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetDescription());
     78#else
    7279        fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetName());
    7380#endif
    74         if( EQUAL(poR->GetDriver(iDriver)->GetName(),oDriver) )
     81#endif
     82        if( EQUAL(
     83#if GDAL_VERSION_MAJOR >= 2
     84                  poR->GetDriver(iDriver)->GetDescription()
     85#else
     86                  poR->GetDriver(iDriver)->GetName()
     87#endif
     88                  ,
     89                  oDriver) )
    7590          {
    7691            poDriver = poR->GetDriver(iDriver);
     
    86101        for( iDriver = 0; iDriver < poR->GetDriverCount(); iDriver++ )
    87102          {
     103#if GDAL_VERSION_MAJOR >= 2
     104            sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetDescription() );
     105#else
    88106            sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetName() );
     107#endif
    89108          }
    90109
     
    94113      }
    95114
    96     if( !poDriver->TestCapability( ODrCCreateDataSource ) ){
    97       char emessage[1024];
    98       sprintf( emessage,  "%s driver does not support data source creation.\n",
    99                "json" );
    100       setMapInMaps(conf,"lenv","message",emessage);
    101       return SERVICE_FAILED;
    102     }
     115#if GDAL_VERSION_MAJOR >=2
     116    if( !CPLTestBool( CSLFetchNameValueDef(poDriver->GetMetadata(), GDAL_DCAP_CREATE, "FALSE") ) )
     117#else
     118    if( !poDriver->TestCapability( ODrCCreateDataSource ) )
     119#endif
     120      {
     121        char emessage[1024];
     122        sprintf( emessage,  "%s driver does not support data source creation.\n",
     123                 "json" );
     124        setMapInMaps(conf,"lenv","message",emessage);
     125        return SERVICE_FAILED;
     126      }
    103127
    104128    /* -------------------------------------------------------------------- */
     
    108132    char **papszDSCO=NULL;
    109133    sprintf(pszDestDataSource,"/vsimem/result_%d",getpid());
     134#if GDAL_VERSION_MAJOR >=2
     135    poODS = poDriver->Create( pszDestDataSource, 0, 0, 0, GDT_Unknown, papszDSCO );
     136#else
    110137    poODS = poDriver->CreateDataSource( pszDestDataSource, papszDSCO );
     138#endif
    111139    if( poODS == NULL ){
    112140      char emessage[1024];     
  • trunk/zoo-project/zoo-services/cgal/voronoi.c

    r546 r775  
    6767    /*      Try opening the output datasource as an existing, writable      */
    6868    /* -------------------------------------------------------------------- */
    69     OGRDataSource       *poODS;
    70    
     69#if GDAL_VERSION_MAJOR >= 2
     70    GDALDataset *poODS;
     71    GDALDriverManager* poR=GetGDALDriverManager();
     72    GDALDriver          *poDriver = NULL;
     73#else
     74    OGRDataSource       *poODS;   
    7175    OGRSFDriverRegistrar *poR = OGRSFDriverRegistrar::GetRegistrar();
    7276    OGRSFDriver          *poDriver = NULL;
     77#endif
    7378    int                  iDriver;
    74 
    7579    map* tmpMap=getMapFromMaps(outputs,"Result","mimeType");
    7680    const char *oDriver;
     
    8791      {
    8892#ifdef DEBUG
     93#if GDAL_VERSION_MAJOR >= 2
     94        fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetDescription());
     95#else
    8996        fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetName());
    9097#endif
    91         if( EQUAL(poR->GetDriver(iDriver)->GetName(),oDriver) )
     98#endif
     99        if( EQUAL(
     100#if GDAL_VERSION_MAJOR >= 2
     101                  poR->GetDriver(iDriver)->GetDescription()
     102#else
     103                  poR->GetDriver(iDriver)->GetName()
     104#endif
     105                  ,
     106                  oDriver) )
    92107          {
    93108            poDriver = poR->GetDriver(iDriver);
     
    103118        for( iDriver = 0; iDriver < poR->GetDriverCount(); iDriver++ )
    104119          {
     120#if GDAL_VERSION_MAJOR >= 2
     121            sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetDescription() );
     122#else
    105123            sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetName() );
     124#endif
    106125          }
    107126
     
    111130      }
    112131
    113     if( !poDriver->TestCapability( ODrCCreateDataSource ) ){
    114       char emessage[1024];
    115       sprintf( emessage,  "%s driver does not support data source creation.\n",
    116                "json" );
    117       setMapInMaps(conf,"lenv","message",emessage);
    118       return SERVICE_FAILED;
    119     }
     132#if GDAL_VERSION_MAJOR >=2
     133    if( !CPLTestBool( CSLFetchNameValueDef(poDriver->GetMetadata(), GDAL_DCAP_CREATE, "FALSE") ) )
     134#else
     135    if( !poDriver->TestCapability( ODrCCreateDataSource ) )
     136#endif
     137      {
     138        char emessage[1024];
     139        sprintf( emessage,  "%s driver does not support data source creation.\n",
     140                 "json" );
     141        setMapInMaps(conf,"lenv","message",emessage);
     142        return SERVICE_FAILED;
     143      }
    120144
    121145    /* -------------------------------------------------------------------- */
     
    126150    char **papszDSCO=NULL;
    127151    sprintf(pszDestDataSource,"/vsimem/result_%d.json",tpath->value,getpid());
     152#if GDAL_VERSION_MAJOR >=2
     153    poODS = poDriver->Create( pszDestDataSource, 0, 0, 0, GDT_Unknown, papszDSCO );
     154#else
    128155    poODS = poDriver->CreateDataSource( pszDestDataSource, papszDSCO );
     156#endif
    129157    if( poODS == NULL ){
    130158      char emessage[1024];     
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