成功解决 WorldWind1.4.1 无法浏览到自已发布的影像数据

PluginSDK项目中ImageStore.cs文件,从第236行代码开始看:

-------------------------------------------------------------

  //List of cache structures to try, in order of preference
            string[] patternArray = {
                @"{0}\{1:D1}\{1:D1}_{2:D1}.{3}",
                @"{0}\{1:D4}\{1:D4}_{2:D4}.{3}"
            };
            
foreach(string relativePattern in patternArray) {
                //Try each pattern through
                string relativePath = String.Format(relativePattern,
          qt.Level, qt.Row, qt.Col, m_imageFileExtension);

         if(m_dataDirectory != null)
         {
            // Search data directory first
           string rawFullPath = Path.Combine( m_dataDirectory, relativePath );
                     if (File.Exists(rawFullPath))
                        return rawFullPath;
                                         
         }

         // If cache doesn't exist, fall back to duplicate texture path.
          if (m_cacheDirectory == null)
                  return m_duplicateTexturePath;

          //此处省略其它代码.....

}

--------------------------------------------------------------

红色部分代码最为关键,当采用@"{0}\{1:D1}\{1:D1}_{2:D1}.{3}"这种模式找到瓦片文件时,就返回。而没有再用第二种模式@"{0}\{1:D4}\{1:D4}_{2:D4}.{3}"来进行查找。这样wordwind就看不到图了。

DsTile工具切出来的图刚好是第二种模式。

问题已找出,修改当然很容易了。

string rawFullPath = Path.Combine( m_dataDirectory, relativePath );
  if (File.Exists(rawFullPath))
         return rawFullPath;
   else
     {
          if (relativePattern != patternArray[patternArray.Length - 1]) continue;
     }


 

原文地址:https://www.cnblogs.com/janehlp/p/1983990.html