Esempio n. 1
0
 public void MetaDataFromSampleFileWorks()
 {
     Assert.True(Mathf.Abs((float)metadata.GetCellsize() - 10.0F) < precision, "Cellsize not correct.");
     Assert.True(metadata.GetColumns() == 10, "ncols not correct.");
     Assert.True(metadata.GetRows() == 13, "nrows not correct.");
     Assert.True(Mathf.Abs(metadata.GetMaxHeight() - 1960.91F) < precision, "maxheight not correct.");
     Assert.True(Mathf.Abs(metadata.GetMinHeight() - 1951.887F) < precision, "minheight not correct.");
     Assert.True(metadata.GetDataType() == BinaryDataType.Single, "Data type not correct.");
     Assert.True(Mathf.Abs((float)(metadata.GetLowerLeftCornerX() - (-12492736.0119444))) < precision, "Lower left corner X value not correct.");
     Assert.True(Mathf.Abs((float)(metadata.GetLowerLeftCornerY() - (4302859.27676796))) < precision, "Lower left corner Y value not correct.");
 }
Esempio n. 2
0
 private static void ReplaceNoDataValuesWithMinHeight(BinaryFileMetadata metadata, float[,] data)
 {
     for (int x = 0; x < metadata.GetColumns(); x++)
     {
         for (int y = 0; y < metadata.GetRows(); y++)
         {
             if (data[x, y] < lowestPossibleHeight)
             {
                 data[x, y] = metadata.GetMinHeight();
             }
         }
     }
 }