@@ -842,15 +842,15 @@ class RasterTestCase {
842842 [0.10 , 0.45 , 0.193 , 0.2 , 12.456 , 0.2 , 0.0 ]
843843 ]
844844 Raster raster = new Raster (data, bounds)
845- String str = raster. getValuesAsString(0 , 0 , 7 , 5 ). denormalize()
845+ String str = raster. getValuesAsString(0 , 0 , 7 , 5 , numberOfDecimals : 3 ). denormalize()
846846 assertEquals (""" 0.100 0.450 0.193 0.200 12.456 0.200 0.000
847847 0.100 1.450 1.193 1.200 112.456 1.200 0.000
848848 0.100 1.450 2.193 3.200 212.456 1.200 0.000
849849 0.100 1.450 1.193 1.200 112.456 1.200 0.000
850850 0.100 0.450 0.193 0.200 12.456 0.200 0.000
851851""" . denormalize(), str)
852852
853- str = raster. getValuesAsString(0 , 0 , 7 , 5 , prettyPrint : true ). denormalize()
853+ str = raster. getValuesAsString(0 , 0 , 7 , 5 , prettyPrint : true , numberOfDecimals : 3 ). denormalize()
854854 assertEquals (""" -----------------------------------------------------------------------
855855| 0.100 | 0.450 | 0.193 | 0.200 | 12.456 | 0.200 | 0.000 |
856856-----------------------------------------------------------------------
@@ -866,6 +866,40 @@ class RasterTestCase {
866866
867867 }
868868
869+ @Test void getLargeValuesAsString () {
870+ Bounds bounds = new Bounds (7 , 7 , 17 , 15 , " EPSG:4326" )
871+ List data = [
872+ [12120.10 , 12120.45 , 12120.193 , 12120.2 , 121212.456 , 12120.2 , 0.0 ],
873+ [12120.10 , 11212.45 , 12121.193 , 11212.2 , 1121212.456 , 11212.2 , 0.0 ],
874+ [1210.10 , 12121.45 , 21212.193 , 31212.2 , 2112122.456 , 12121.2 , 0.0 ],
875+ [12.10 , 11212.45 , 11212.193 , 12121.2 , 1212112.456 , 11212.2 , 0.0 ],
876+ [12120.10 , 12120.45 , 12120.193 , 12120.2 , 112122.456 , 12120.2 , 0.0 ]
877+ ]
878+ Raster raster = new Raster (data, bounds)
879+ String str = raster. getValuesAsString(0 , 0 , 7 , 5 ). denormalize()
880+ assertEquals (""" 12120.10 12120.45 12120.19 12120.20 121212.45 12120.20 0.00
881+ 12120.10 11212.45 12121.19 11212.20 1121212.50 11212.20 0.00
882+ 1210.10 12121.45 21212.19 31212.20 2112122.50 12121.20 0.00
883+ 12.10 11212.45 11212.19 12121.20 1212112.50 11212.20 0.00
884+ 12120.10 12120.45 12120.19 12120.20 112122.45 12120.20 0.00
885+ """ . denormalize(), str)
886+
887+ str = raster. getValuesAsString(0 , 0 , 7 , 5 , prettyPrint : true ). denormalize()
888+ assertEquals (""" --------------------------------------------------------------------------------------------
889+ | 12120.10 | 12120.45 | 12120.19 | 12120.20 | 121212.45 | 12120.20 | 0.00 |
890+ --------------------------------------------------------------------------------------------
891+ | 12120.10 | 11212.45 | 12121.19 | 11212.20 | 1121212.50 | 11212.20 | 0.00 |
892+ --------------------------------------------------------------------------------------------
893+ | 1210.10 | 12121.45 | 21212.19 | 31212.20 | 2112122.50 | 12121.20 | 0.00 |
894+ --------------------------------------------------------------------------------------------
895+ | 12.10 | 11212.45 | 11212.19 | 12121.20 | 1212112.50 | 11212.20 | 0.00 |
896+ --------------------------------------------------------------------------------------------
897+ | 12120.10 | 12120.45 | 12120.19 | 12120.20 | 112122.45 | 12120.20 | 0.00 |
898+ --------------------------------------------------------------------------------------------
899+ """ . denormalize(), str)
900+
901+ }
902+
869903 @Test void getData () {
870904 File file = new File (getClass(). getClassLoader(). getResource(" alki.tif" ). toURI())
871905 GeoTIFF geoTIFF = new GeoTIFF (file)
0 commit comments