Index: trunk/zoo-project/zoo-services/cgal/cgal_service.c
===================================================================
--- trunk/zoo-project/zoo-services/cgal/cgal_service.c	(revision 771)
+++ trunk/zoo-project/zoo-services/cgal/cgal_service.c	(revision 775)
@@ -29,8 +29,19 @@
   VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE);
   VSIFCloseL(ifile);
+#if GDAL_VERSION_MAJOR >= 2
+  GDALDataset *ipoDS =
+    (GDALDataset*) GDALOpenEx( filename,
+			       GDAL_OF_READONLY | GDAL_OF_VECTOR,
+			       NULL, NULL, NULL );
+#else
   OGRDataSource* ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE);
+#endif
   if( ipoDS == NULL )
     {
+#if GDAL_VERSION_MAJOR >= 2
+      GDALDriverManager* poR=GetGDALDriverManager();
+#else
       OGRSFDriverRegistrar    *poR = OGRSFDriverRegistrar::GetRegistrar();
+#endif
       
       fprintf( stderr, "FAILURE:\n"
@@ -40,5 +51,9 @@
       for( int iDriver = 0; iDriver < poR->GetDriverCount(); iDriver++ )
         {
-	  fprintf( stderr, "  -> %s\n", poR->GetDriver(iDriver)->GetName() );
+#if GDAL_VERSION_MAJOR >= 2
+	    fprintf( stderr, "  -> %s\n", poR->GetDriver(iDriver)->GetDescription() );
+#else
+	    fprintf( stderr, "  -> %s\n", poR->GetDriver(iDriver)->GetName() );
+#endif
         }
       char tmp[1024];
Index: trunk/zoo-project/zoo-services/cgal/delaunay.c
===================================================================
--- trunk/zoo-project/zoo-services/cgal/delaunay.c	(revision 771)
+++ trunk/zoo-project/zoo-services/cgal/delaunay.c	(revision 775)
@@ -50,10 +50,14 @@
     /*      Try opening the output datasource as an existing, writable      */
     /* -------------------------------------------------------------------- */
-    OGRDataSource       *poODS;
-    
+#if GDAL_VERSION_MAJOR >= 2
+    GDALDataset *poODS;
+    GDALDriverManager* poR=GetGDALDriverManager();
+    GDALDriver          *poDriver = NULL;
+#else
+    OGRDataSource       *poODS;    
     OGRSFDriverRegistrar *poR = OGRSFDriverRegistrar::GetRegistrar();
     OGRSFDriver          *poDriver = NULL;
+#endif
     int                  iDriver;
-
     map *tmpMap=getMapFromMaps(outputs,"Result","mimeType");
     const char *oDriver;
@@ -70,7 +74,18 @@
       {
 #ifdef DEBUG
+#if GDAL_VERSION_MAJOR >= 2
+	fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetDescription());
+#else
 	fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetName());
 #endif
-	if( EQUAL(poR->GetDriver(iDriver)->GetName(),oDriver) )
+#endif
+	if( EQUAL(
+#if GDAL_VERSION_MAJOR >= 2
+		  poR->GetDriver(iDriver)->GetDescription()
+#else
+		  poR->GetDriver(iDriver)->GetName()
+#endif
+		  ,
+		  oDriver) )
 	  {
 	    poDriver = poR->GetDriver(iDriver);
@@ -86,5 +101,9 @@
 	for( iDriver = 0; iDriver < poR->GetDriverCount(); iDriver++ )
 	  {
+#if GDAL_VERSION_MAJOR >= 2
+	    sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetDescription() );
+#else
 	    sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetName() );
+#endif
 	  }
 
@@ -94,11 +113,16 @@
       }
 
-    if( !poDriver->TestCapability( ODrCCreateDataSource ) ){
-      char emessage[1024];
-      sprintf( emessage,  "%s driver does not support data source creation.\n",
-	       "json" );
-      setMapInMaps(conf,"lenv","message",emessage);
-      return SERVICE_FAILED;
-    }
+#if GDAL_VERSION_MAJOR >=2
+    if( !CPLTestBool( CSLFetchNameValueDef(poDriver->GetMetadata(), GDAL_DCAP_CREATE, "FALSE") ) )
+#else
+    if( !poDriver->TestCapability( ODrCCreateDataSource ) )
+#endif
+      {
+	char emessage[1024];
+	sprintf( emessage,  "%s driver does not support data source creation.\n",
+		 "json" );
+	setMapInMaps(conf,"lenv","message",emessage);
+	return SERVICE_FAILED;
+      }
 
     /* -------------------------------------------------------------------- */
@@ -108,5 +132,9 @@
     char **papszDSCO=NULL;
     sprintf(pszDestDataSource,"/vsimem/result_%d",getpid());
+#if GDAL_VERSION_MAJOR >=2
+    poODS = poDriver->Create( pszDestDataSource, 0, 0, 0, GDT_Unknown, papszDSCO );
+#else
     poODS = poDriver->CreateDataSource( pszDestDataSource, papszDSCO );
+#endif
     if( poODS == NULL ){
       char emessage[1024];      
Index: trunk/zoo-project/zoo-services/cgal/voronoi.c
===================================================================
--- trunk/zoo-project/zoo-services/cgal/voronoi.c	(revision 771)
+++ trunk/zoo-project/zoo-services/cgal/voronoi.c	(revision 775)
@@ -67,10 +67,14 @@
     /*      Try opening the output datasource as an existing, writable      */
     /* -------------------------------------------------------------------- */
-    OGRDataSource       *poODS;
-    
+#if GDAL_VERSION_MAJOR >= 2
+    GDALDataset *poODS;
+    GDALDriverManager* poR=GetGDALDriverManager();
+    GDALDriver          *poDriver = NULL;
+#else
+    OGRDataSource       *poODS;    
     OGRSFDriverRegistrar *poR = OGRSFDriverRegistrar::GetRegistrar();
     OGRSFDriver          *poDriver = NULL;
+#endif
     int                  iDriver;
-
     map* tmpMap=getMapFromMaps(outputs,"Result","mimeType");
     const char *oDriver;
@@ -87,7 +91,18 @@
       {
 #ifdef DEBUG
+#if GDAL_VERSION_MAJOR >= 2
+	fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetDescription());
+#else
 	fprintf(stderr,"D:%s\n",poR->GetDriver(iDriver)->GetName());
 #endif
-	if( EQUAL(poR->GetDriver(iDriver)->GetName(),oDriver) )
+#endif
+	if( EQUAL(
+#if GDAL_VERSION_MAJOR >= 2
+		  poR->GetDriver(iDriver)->GetDescription()
+#else
+		  poR->GetDriver(iDriver)->GetName()
+#endif
+		  ,
+		  oDriver) )
 	  {
 	    poDriver = poR->GetDriver(iDriver);
@@ -103,5 +118,9 @@
 	for( iDriver = 0; iDriver < poR->GetDriverCount(); iDriver++ )
 	  {
+#if GDAL_VERSION_MAJOR >= 2
+	    sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetDescription() );
+#else
 	    sprintf( emessage,  "%s  -> `%s'\n", emessage, poR->GetDriver(iDriver)->GetName() );
+#endif
 	  }
 
@@ -111,11 +130,16 @@
       }
 
-    if( !poDriver->TestCapability( ODrCCreateDataSource ) ){
-      char emessage[1024];
-      sprintf( emessage,  "%s driver does not support data source creation.\n",
-	       "json" );
-      setMapInMaps(conf,"lenv","message",emessage);
-      return SERVICE_FAILED;
-    }
+#if GDAL_VERSION_MAJOR >=2
+    if( !CPLTestBool( CSLFetchNameValueDef(poDriver->GetMetadata(), GDAL_DCAP_CREATE, "FALSE") ) )
+#else
+    if( !poDriver->TestCapability( ODrCCreateDataSource ) )
+#endif
+      {
+	char emessage[1024];
+	sprintf( emessage,  "%s driver does not support data source creation.\n",
+		 "json" );
+	setMapInMaps(conf,"lenv","message",emessage);
+	return SERVICE_FAILED;
+      }
 
     /* -------------------------------------------------------------------- */
@@ -126,5 +150,9 @@
     char **papszDSCO=NULL;
     sprintf(pszDestDataSource,"/vsimem/result_%d.json",tpath->value,getpid());
+#if GDAL_VERSION_MAJOR >=2
+    poODS = poDriver->Create( pszDestDataSource, 0, 0, 0, GDT_Unknown, papszDSCO );
+#else
     poODS = poDriver->CreateDataSource( pszDestDataSource, papszDSCO );
+#endif
     if( poODS == NULL ){
       char emessage[1024];      
