summaryrefslogtreecommitdiff
path: root/ham/qradiopredict/qradiopredict-gdal2.patch
blob: f6b55a9391096a342b82d9ed5aaca8ceb8b19b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
diff -u -r qradiopredict-0.8.8/QRadioPredict/shpreader.cpp qradiopredict-0.8.8-patched/QRadioPredict/shpreader.cpp
--- qradiopredict-0.8.8/QRadioPredict/shpreader.cpp	2014-02-24 07:56:11.000000000 +0000
+++ qradiopredict-0.8.8-patched/QRadioPredict/shpreader.cpp	2016-03-20 21:04:43.097658012 +0000
@@ -104,9 +104,15 @@
     OGRRegisterAll();
     QString file = name;
     file.append(".shp");
-    OGRDataSource       *poDS;
 
+#if GDAL_VERSION_MAJOR < 2
+    OGRDataSource       *poDS;
     poDS = OGRSFDriverRegistrar::Open( file.toStdString().c_str(), FALSE );
+#else
+    GDALDataset       *poDS;
+    poDS = (GDALDataset*) OGROpen( file.toStdString().c_str(), FALSE, NULL );
+#endif
+
     if( poDS == NULL )
     {
         qDebug() << "Shapefile opening failed: " << name;
@@ -119,7 +125,11 @@
     if(poLayer == NULL)
     {
         qDebug() << "Shapefile layer is fubar: " << poLayer->GetName();
+#if GDAL_VERSION_MAJOR < 2
         OGRDataSource::DestroyDataSource( poDS );
+#else
+        GDALClose( (GDALDatasetH) poDS );
+#endif
         return QString("None");
     }
 
@@ -171,7 +181,11 @@
                     qDebug() << "Using GEOS for: " << terrain_type;
                     delete [] buffer;
                     OGRFeature::DestroyFeature( poFeature );
+#if GDAL_VERSION_MAJOR < 2
                     OGRDataSource::DestroyDataSource( poDS );
+#else
+                    GDALClose( (GDALDatasetH) poDS );
+#endif
                     return terrain_type;
                 }
                 delete[] buffer;
@@ -233,7 +247,11 @@
                 if(poly)
                     delete poly;
                 OGRFeature::DestroyFeature( poFeature );
+#if GDAL_VERSION_MAJOR < 2
                 OGRDataSource::DestroyDataSource( poDS );
+#else
+                GDALClose( (GDALDatasetH) poDS );
+#endif
                 return terrain_type;
             }
 
@@ -255,7 +273,11 @@
             {
                 //qDebug() << terrain_type;
                 OGRFeature::DestroyFeature( poFeature );
+#if GDAL_VERSION_MAJOR < 2
                 OGRDataSource::DestroyDataSource( poDS );
+#else
+                GDALClose( (GDALDatasetH) poDS );
+#endif
                 return terrain_type;
             }
             */
@@ -267,7 +289,11 @@
         OGRFeature::DestroyFeature( poFeature );
     }
 
+#if GDAL_VERSION_MAJOR < 2
     OGRDataSource::DestroyDataSource( poDS );
+#else
+    GDALClose( (GDALDatasetH) poDS );
+#endif
 
     return QString("None");
 }