private void PopulateGeoTiffDictionary(GeoTiffDictionary dictionary, FileMetadata mainTile, IGeoTiffService geoTiffService, IEnumerable <FileMetadata> fileMetadataList) { // Add main tile if (!dictionary.ContainsKey(mainTile)) { dictionary[mainTile] = geoTiffService.OpenFile(mainTile.Filename); } foreach (var fileMetadata in fileMetadataList) { if (!dictionary.ContainsKey(fileMetadata)) { dictionary[fileMetadata] = geoTiffService.OpenFile(fileMetadata.Filename); } } }
private float GetElevationAtPoint(FileMetadata mainTile, GeoTiffDictionary tiles, int x, int y, float nullValue) { int xRemap, yRemap; FileMetadata goodTile = FindTile(mainTile, tiles, x, y, out xRemap, out yRemap); if (goodTile == null) { return(nullValue); } if (tiles.ContainsKey(goodTile)) { return(tiles[goodTile].ParseGeoDataAtPoint(goodTile, xRemap, yRemap)); } else { throw new Exception("Tile not found. Should not happen."); } }