[mapserver-commits] r7763 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sat Jun 28 12:31:05 EDT 2008


Author: pramsey
Date: 2008-06-28 12:31:04 -0400 (Sat, 28 Jun 2008)
New Revision: 7763

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapshape.c
Log:
restore old behavior of tiled shapes relative to shapepath with new behavior for when shapepath is undefined (#2369)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-06-28 15:39:24 UTC (rev 7762)
+++ trunk/mapserver/HISTORY.TXT	2008-06-28 16:31:04 UTC (rev 7763)
@@ -12,6 +12,9 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- mapshape.c: restore old behavior of tiled shapes relative to shapepath
+  with new behavior for when shapepath is undefined (#2369)
+
 - maputil.c: fix a bug for offset lines with agg, when the first segment 
   was horizontal (#2659)
 

Modified: trunk/mapserver/mapshape.c
===================================================================
--- trunk/mapserver/mapshape.c	2008-06-28 15:39:24 UTC (rev 7762)
+++ trunk/mapserver/mapshape.c	2008-06-28 16:31:04 UTC (rev 7763)
@@ -1875,18 +1875,23 @@
       
     if(strlen(filename) == 0) continue; /* check again */
       
-    msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename);
-
-    /* open the shapefile */
-    if(msShapefileOpen(tSHP->shpfile, "rb", szPath) == -1) {
+    if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, layer->map->mappath, layer->map->shapepath, filename)) == -1) { 
+      if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename)) == -1) { 
+        if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath(szPath, layer->map->mappath, filename)) == -1) { 
 #ifndef IGNORE_MISSING_DATA
-      if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... fatal error.\n", szPath, layer->name );
-      return(MS_FAILURE);
+          if( layer->debug || layer->map->debug ) {
+            msDebug( "Unable to open file %s for layer %s ... fatal error.\n", filename, layer->name ); 
+          }
+          return(MS_FAILURE); 
 #else
-      if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
-      continue; /* check again */
+          if( layer->debug || layer->map->debug ) {
+            msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
+          }
+          continue; /* check again */
 #endif
-    }
+        }
+      } 
+    }      
 
     return(MS_SUCCESS); /* found a template, ok to proceed */
   }
@@ -1937,17 +1942,22 @@
 
       if(strlen(filename) == 0) continue; /* check again */
 
-      msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename);
-
-      /* open the shapefile */
-      if(msShapefileOpen(tSHP->shpfile, "rb", szPath) == -1) {
+      if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, layer->map->mappath, layer->map->shapepath, filename)) == -1) { 
+        if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename)) == -1) { 
+          if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath(szPath, layer->map->mappath, filename)) == -1) { 
 #ifndef IGNORE_MISSING_DATA
-        if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... fatal error.\n", szPath, layer->name );
-        return(MS_FAILURE);
+            if( layer->debug || layer->map->debug ) {
+              msDebug( "Unable to open file %s for layer %s ... fatal error.\n", filename, layer->name ); 
+            }
+ 	          return(MS_FAILURE); 
 #else
-        if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
-        continue; /* check again */
+            if( layer->debug || layer->map->debug ) {
+              msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
+            }
+            continue; /* check again */
 #endif
+ 	        }
+ 	      } 
       }
 
       status = msShapefileWhichShapes(tSHP->shpfile, rect, layer->debug);
@@ -1985,18 +1995,23 @@
         }
 
         if(strlen(filename) == 0) continue; /* check again */
-      
-        msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename);
 
-        /* open the shapefile */
-        if(msShapefileOpen(tSHP->shpfile, "rb", szPath) == -1) {
+        if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, layer->map->mappath, layer->map->shapepath, filename)) == -1) { 
+          if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename)) == -1) { 
+            if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath(szPath, layer->map->mappath, filename)) == -1) { 
 #ifndef IGNORE_MISSING_DATA
-          if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... fatal error.\n", szPath, layer->name );
-          return(MS_FAILURE);
+              if( layer->debug || layer->map->debug ) {
+                msDebug( "Unable to open file %s for layer %s ... fatal error.\n", filename, layer->name ); 
+              }
+ 	            return(MS_FAILURE); 
 #else
-          if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
-          continue; /* check again */
+              if( layer->debug || layer->map->debug ) {
+                msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
+              }
+              continue; /* check again */
 #endif
+ 	          }
+ 	        } 
         }
 
         status = msShapefileWhichShapes(tSHP->shpfile, rect, layer->debug);
@@ -2072,17 +2087,22 @@
 
           if(strlen(filename) == 0) continue; /* check again */
 
-          msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename);
-
-          /* open the shapefile */
-          if(msShapefileOpen(tSHP->shpfile, "rb", szPath) == -1) {
+          if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, layer->map->mappath, layer->map->shapepath, filename)) == -1) { 
+            if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename)) == -1) { 
+              if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath(szPath, layer->map->mappath, filename)) == -1) { 
 #ifndef IGNORE_MISSING_DATA
-            if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... fatal error.\n", szPath, layer->name );
-            return(MS_FAILURE);
+                if( layer->debug || layer->map->debug ) {
+                  msDebug( "Unable to open file %s for layer %s ... fatal error.\n", filename, layer->name ); 
+                }
+ 	              return(MS_FAILURE); 
 #else
-            if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
-            continue; /* check again */
+                if( layer->debug || layer->map->debug ) {
+                  msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
+                }
+                continue; /* check again */
 #endif
+ 	            }
+ 	          } 
           }
 
           status = msShapefileWhichShapes(tSHP->shpfile, tSHP->tileshpfile->statusbounds, layer->debug);
@@ -2120,17 +2140,22 @@
 
             if(strlen(filename) == 0) continue; /* check again */
 
-            msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename);
-
-            /* open the shapefile */
-            if(msShapefileOpen(tSHP->shpfile, "rb", szPath) == -1) {
+            if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, layer->map->mappath, layer->map->shapepath, filename)) == -1) { 
+              if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename)) == -1) { 
+                if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath(szPath, layer->map->mappath, filename)) == -1) { 
 #ifndef IGNORE_MISSING_DATA
-              if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... fatal error.\n", szPath, layer->name );
-              return(MS_FAILURE);
+                  if( layer->debug || layer->map->debug ) {
+                    msDebug( "Unable to open file %s for layer %s ... fatal error.\n", filename, layer->name ); 
+                  }
+ 	                return(MS_FAILURE); 
 #else
-              if( layer->debug || layer->map->debug ) msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
-              continue; /* check again */
+                  if( layer->debug || layer->map->debug ) {
+                    msDebug( "Unable to open shapefile %s for layer %s ... ignoring this missing data.\n", szPath, layer->name );
+                  }
+                  continue; /* check again */
 #endif
+ 	              }
+ 	            } 
             }
 
             status = msShapefileWhichShapes(tSHP->shpfile, tSHP->tileshpfile->statusbounds, layer->debug);
@@ -2214,14 +2239,14 @@
       
     /* open the shapefile, since a specific tile was request an error should be generated if that tile does not exist */
     if(strlen(filename) == 0) return(MS_FAILURE);
+    if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename)) == -1) { 
+      if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath3(szPath, layer->map->mappath, layer->map->shapepath, filename)) == -1) { 
+        if(msShapefileOpen(tSHP->shpfile, "rb", msBuildPath(szPath, layer->map->mappath, filename)) == -1) { 
+          return(MS_FAILURE); 
+        }
+      } 
+    }    
 
-    msTileIndexAbsoluteDir(tiFileAbsDir, layer);
-
-    msBuildPath3(szPath, tiFileAbsDir, layer->map->shapepath, filename);
-
-    if(msShapefileOpen(tSHP->shpfile, "rb", szPath) == -1) {
-      return(MS_FAILURE);
-    }
   }
 
   if((record < 0) || (record >= tSHP->shpfile->numshapes)) return(MS_FAILURE);



More information about the mapserver-commits mailing list