[mapserver-commits] r7191 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Dec 19 12:48:12 EST 2007


Author: warmerdam
Date: 2007-12-19 12:48:12 -0500 (Wed, 19 Dec 2007)
New Revision: 7191

Modified:
   trunk/mapserver/mapogr.cpp
Log:
check GDAL version before using newer OGR functions - related to (#545)

Modified: trunk/mapserver/mapogr.cpp
===================================================================
--- trunk/mapserver/mapogr.cpp	2007-12-19 15:54:25 UTC (rev 7190)
+++ trunk/mapserver/mapogr.cpp	2007-12-19 17:48:12 UTC (rev 7191)
@@ -1077,11 +1077,19 @@
   OGRGeometryH hSpatialFilterPolygon = OGR_G_CreateGeometry( wkbPolygon );
   OGRGeometryH hRing = OGR_G_CreateGeometry( wkbLinearRing );
 
+#if GDAL_VERSION_NUM >= 1310
   OGR_G_AddPoint_2D( hRing, rect.minx, rect.miny);
   OGR_G_AddPoint_2D( hRing, rect.maxx, rect.miny);
   OGR_G_AddPoint_2D( hRing, rect.maxx, rect.maxy);
   OGR_G_AddPoint_2D( hRing, rect.minx, rect.maxy);
   OGR_G_AddPoint_2D( hRing, rect.minx, rect.miny);
+#else
+  OGR_G_AddPoint( hRing, rect.minx, rect.miny);
+  OGR_G_AddPoint( hRing, rect.maxx, rect.miny);
+  OGR_G_AddPoint( hRing, rect.maxx, rect.maxy);
+  OGR_G_AddPoint( hRing, rect.minx, rect.maxy);
+  OGR_G_AddPoint( hRing, rect.minx, rect.miny);
+#endif
 
   OGR_G_AddGeometryDirectly( hSpatialFilterPolygon, hRing );
 
@@ -2682,8 +2690,10 @@
     ACQUIRE_OGR_LOCK;
     if( bOGRDriversRegistered == MS_TRUE )
     {
+#if GDAL_VERSION_NUM >= 1400
         OGRCleanupAll();
         bOGRDriversRegistered = MS_FALSE;
+#endif
     }
     RELEASE_OGR_LOCK;
 #endif



More information about the mapserver-commits mailing list