Ignore:
Timestamp:
Dec 19, 2016, 6:01:06 PM (8 years ago)
Author:
djay
Message:

Add support for nested inputs and outputs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c

    r766 r790  
    591591/* -------------------------------------------------------------------- */
    592592#if GDAL_VERSION_MAJOR >= 2
    593       GDALDataset *poDS;
     593      GDALDataset *poDS
     594        = (GDALDataset*) GDALOpenEx( pszDataSource,
     595                                     GDAL_OF_READONLY | GDAL_OF_VECTOR,
     596                                     NULL, NULL, NULL );
    594597      GDALDataset *poODS;
    595598      GDALDriverManager* poR=GetGDALDriverManager();
    596599      GDALDriver          *poDriver = NULL;
    597600#else
    598       OGRDataSource* poDS;
     601      OGRDataSource* poDS
     602        = OGRSFDriverRegistrar::Open( pszDataSource, FALSE );
    599603      OGRDataSource *poODS;
    600604      OGRSFDriverRegistrar    *poR = OGRSFDriverRegistrar::GetRegistrar();
     
    737741        if( poODS == NULL )
    738742        {
     743          poODS =
     744#if GDAL_VERSION_MAJOR >= 2
     745            (GDALDataset*) GDALOpenEx( pszDestDataSource,
     746                                       GDAL_OF_UPDATE | GDAL_OF_VECTOR,
     747                                       NULL, NULL, NULL )
     748#else
     749            OGRSFDriverRegistrar::Open( pszDestDataSource, TRUE )
     750#endif
     751            ;
     752          if( poODS == NULL )
     753            {
     754              fprintf( stderr, "FAILURE:\n"
     755                       "Unable to open existing output datasource `%s'.\n",
     756                       pszDestDataSource );
     757#ifdef ZOO_SERVICE
     758              char tmp[1024];
     759              sprintf(tmp,"Unable to open existing output datasource `%s'.",pszDestDataSource);
     760              setMapInMaps(conf,"lenv","message",tmp);
     761              return SERVICE_FAILED;
     762#else
     763              exit( 1 );
     764#endif
     765
    739766            fprintf( stderr,  "%s driver failed to create %s\n",
    740767                    pszFormat, pszDestDataSource );
    741 #ifdef ZOO_SERVICE
    742             char tmp[1024];
    743             sprintf(tmp,"%s driver failed to create %s",pszFormat, pszDestDataSource);
    744             setMapInMaps(conf,"lenv","message",tmp);
    745             return SERVICE_FAILED;
    746 #else
    747             exit( 1 );
    748 #endif
     768            }
    749769        }
    750770    }
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