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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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];     
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