[mapserver-commits] r7991 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Oct 22 14:30:01 EDT 2008


Author: pramsey
Date: 2008-10-22 14:30:01 -0400 (Wed, 22 Oct 2008)
New Revision: 7991

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/maprasterquery.c
Log:
raster query fix for tileindex with relative paths (#2722)



Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-10-22 17:46:56 UTC (rev 7990)
+++ trunk/mapserver/HISTORY.TXT	2008-10-22 18:30:01 UTC (rev 7991)
@@ -12,6 +12,8 @@
 Current Version (5.3-dev, SVN trunk):
 ------------------------------------
 
+- raster query fix for tileindex with relative paths (#2722)
+
 - Fixed msOGRGetValues function to return default values if the object 
   type is not TEXT. (#2311)
 

Modified: trunk/mapserver/maprasterquery.c
===================================================================
--- trunk/mapserver/maprasterquery.c	2008-10-22 17:46:56 UTC (rev 7990)
+++ trunk/mapserver/maprasterquery.c	2008-10-22 18:30:01 UTC (rev 7991)
@@ -667,6 +667,8 @@
     char szPath[MS_MAXPATHLEN];
     rectObj searchrect;
     rasterLayerInfo *rlinfo = NULL;
+    char tiAbsFilePath[MS_MAXPATHLEN];
+    char *tiAbsDirPath = NULL;
 
 /* -------------------------------------------------------------------- */
 /*      Get the layer info.                                             */
@@ -771,10 +773,20 @@
 /* -------------------------------------------------------------------- */
         msGDALInitialize();
 
+        /*
+        ** If using a tileindex then build the path relative to that file if SHAPEPATH is not set.
+        */
+        if(layer->tileindex && !map->shapepath) { 
+            msBuildPath(tiAbsFilePath, map->mappath, layer->tileindex); /* absolute path to tileindex file */
+            tiAbsDirPath = msGetPath(tiAbsFilePath); /* tileindex file's directory */
+            msBuildPath(szPath, tiAbsDirPath, filename); 
+            free(tiAbsDirPath);
+        } else {
+            msBuildPath3(szPath, map->mappath, map->shapepath, filename);
+        }
+
         msAcquireLock( TLOCK_GDAL );
-        hDS = GDALOpen(
-            msBuildPath3( szPath, map->mappath, map->shapepath, filename ), 
-            GA_ReadOnly );
+        hDS = GDALOpen(szPath, GA_ReadOnly );
         
         if( hDS == NULL )
         {



More information about the mapserver-commits mailing list