private List<IGeoRasterData> LoadPlanetHeightData() { List<IGeoRasterData> list = new List<IGeoRasterData>(); GeoIndexFile file = new GeoIndexFile(this.m_CurrentProjectFolder.HeightIndexPath); if (!file.Read()) { this.m_IsAnyFileNotExist = true; this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Heights index file is error!\r\n"; this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Your heights index file path is " + this.m_CurrentProjectFolder.HeightIndexPath + "\r\n"; this.m_CurrentProjectFolder.HeightIndexPath = ""; return list; } string folderNodeName = this.GetFolderNodeName(NodeType.Heights, this.m_CurrentProjectFolder.HeightIndexPath); string directoryName = Path.GetDirectoryName(this.m_CurrentProjectFolder.HeightIndexPath); for (int i = 0; i < file.BinaryFileName.Count; i++) { string path = Path.Combine(directoryName, file.BinaryFileName[i]); if (!File.Exists(path)) { string str4 = string.Format("Height file {0} doesn't exist.", path); this.m_LoadingErrorStr = this.m_LoadingErrorStr + str4 + "\r\n"; } else { GeoXYRect geoBound = new GeoXYRect(file.LeftOfBound[i], file.RightOfBound[i], file.BottomOfBound[i], file.TopOfBound[i]); GeoIntervalData item = new GeoPlanetHeightData(path, geoBound, file.Resolution[i], false); item.FolderNodeName = folderNodeName; item.Read(); list.Add(item); } } return list; }
public void LoadBuildingData() { try { if (!this.CheckBuildingFile()) { MultiThreadNum.CurrentProgressValue += 0x12; } else { MultiThreadNum.CurrentProgressValue += 8; GeoIndexFile file = new GeoIndexFile(this.m_CurrentProjectFolder.BuildingIndexPath); if (!file.Read()) { this.m_IsAnyFileNotExist = true; this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Clutter heights(building) index file is error!\r\n"; this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Your clutter heights(building) file path is " + this.m_CurrentProjectFolder.BuildingIndexPath + "\r\n"; this.m_CurrentProjectFolder.BuildingIndexPath = ""; } else { string directoryName = Path.GetDirectoryName(this.m_CurrentProjectFolder.BuildingIndexPath); string folderNodeName = this.GetFolderNodeName(NodeType.Buildings, this.m_CurrentProjectFolder.BuildingIndexPath); for (int i = 0; i < file.BinaryFileName.Count; i++) { string path = Path.Combine(directoryName, file.BinaryFileName[i]); if (!File.Exists(path)) { string str4 = string.Format("Building file {0} doesn't exits.", path); this.m_LoadingErrorStr = this.m_LoadingErrorStr + str4 + "\r\n"; } else { GeoXYRect geoBound = new GeoXYRect(file.LeftOfBound[i], file.RightOfBound[i], file.BottomOfBound[i], file.TopOfBound[i]); GeoIntervalData item = new GeoPlanetHeightData(path, geoBound, file.Resolution[i], true); item.FolderNodeName = folderNodeName; item.Read(); this.m_BuildingRasterData.Add(item); } } MultiThreadNum.CurrentProgressValue += 10; } } } catch (Exception exception) { WriteLog.Logger.Error(exception.Message); for (Exception exception2 = exception.InnerException; null != exception2; exception2 = exception2.InnerException) { WriteLog.Logger.Error(exception2.Message); } } }