[mapserver-commits] r7990 - branches/branch-5-2/mapserver

svn at osgeo.org svn at osgeo.org
Wed Oct 22 13:46:57 EDT 2008


Author: pramsey
Date: 2008-10-22 13:46:56 -0400 (Wed, 22 Oct 2008)
New Revision: 7990

Modified:
   branches/branch-5-2/mapserver/HISTORY.TXT
   branches/branch-5-2/mapserver/maprasterquery.c
Log:
raster query fix for tileindex with relative paths (#2722)



Modified: branches/branch-5-2/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-2/mapserver/HISTORY.TXT	2008-10-20 17:27:55 UTC (rev 7989)
+++ branches/branch-5-2/mapserver/HISTORY.TXT	2008-10-22 17:46:56 UTC (rev 7990)
@@ -13,6 +13,8 @@
 Current Version (SVN branch-5-2)
 --------------------------------
 
+- raster query fix for tileindex with relative paths (#2722)
+
 - Fix for the access violation caused by msMSSQL2008LayerGetShape (#2795)
 
 - Fixed msMSSQL2008LayerGetItems to retrieve the column names properly (#2791)

Modified: branches/branch-5-2/mapserver/maprasterquery.c
===================================================================
--- branches/branch-5-2/mapserver/maprasterquery.c	2008-10-20 17:27:55 UTC (rev 7989)
+++ branches/branch-5-2/mapserver/maprasterquery.c	2008-10-22 17:46:56 UTC (rev 7990)
@@ -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