Changeset 775 for trunk/zoo-project/zoo-services/cgal/delaunay.c
- Timestamp:
- Jun 14, 2016, 11:17:20 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-services/cgal/delaunay.c
r546 r775 50 50 /* Try opening the output datasource as an existing, writable */ 51 51 /* -------------------------------------------------------------------- */ 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; 54 58 OGRSFDriverRegistrar *poR = OGRSFDriverRegistrar::GetRegistrar(); 55 59 OGRSFDriver *poDriver = NULL; 60 #endif 56 61 int iDriver; 57 58 62 map *tmpMap=getMapFromMaps(outputs,"Result","mimeType"); 59 63 const char *oDriver; … … 70 74 { 71 75 #ifdef DEBUG 76 #if GDAL_VERSION_MAJOR >= 2 77 fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetDescription()); 78 #else 72 79 fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetName()); 73 80 #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) ) 75 90 { 76 91 poDriver = poR->GetDriver(iDriver); … … 86 101 for( iDriver = 0; iDriver < poR->GetDriverCount(); iDriver++ ) 87 102 { 103 #if GDAL_VERSION_MAJOR >= 2 104 sprintf( emessage, "%s -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetDescription() ); 105 #else 88 106 sprintf( emessage, "%s -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetName() ); 107 #endif 89 108 } 90 109 … … 94 113 } 95 114 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 } 103 127 104 128 /* -------------------------------------------------------------------- */ … … 108 132 char **papszDSCO=NULL; 109 133 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 110 137 poODS = poDriver->CreateDataSource( pszDestDataSource, papszDSCO ); 138 #endif 111 139 if( poODS == NULL ){ 112 140 char emessage[1024];
Note: See TracChangeset
for help on using the changeset viewer.