-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.mjs
29 lines (28 loc) · 1.77 KB
/
test.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import test from "flug";
import { fromFile } from "geotiff";
import Geotransform from "./index.js";
[
[
"abetow-ERD2018-EBIRD_SCIENCE-20191109-a5cf4cb2_hr_2018_abundance_median.tiff",
[-20015109.354, 2962.8066605323957, 0, 10007554.677000001, 0, -2962.8089799495892]
],
["eu_pasture.tiff", [-31.456975828130908, 0.08332825, 0, 80.7984254723645, 0, -0.08332825]],
["GA4886_VanderfordGlacier_2022_EGM2008_64m-epsg3031.cog", [2409321.727264079, 65.02367379354763, 0, -835571.8532756742, 0, -65.02367379354763]],
["gadas.tif", [7698736.857788673, 2445.9849051249894, 0, 1325082.6679127468, 0, -2445.98490512499]],
["GeogToWGS84GeoKey5.tif", [9.0010573796, 0.0000277777778, 0, 52.0013760079, 0, -0.0000277777778]],
["lcv_landuse.cropland_hyde_p_10km_s0..0cm_2016_v3.2.tif", [-180, 0.0833333333333333, 0, 87.37, 0, -0.0833333333333333]],
["no_pixelscale_or_tiepoints.tiff", [-7.583906932854381, 0.010005529647693282, 0, 38.750354738325896, 0, -0.009986188755447628]],
["nt_20201024_f18_nrt_s.tif", [-3950000, 25000, 0, 4350000, 0, -25000]],
["umbra_mount_yasur.tiff", [337934.4836350695, -0.14299987236417117, -0.5767759114507439, 7840518.464866471, -0.5767759114507457, 0.14299987236414916]],
["utm.tif", [688258.223819, 121.52985600000001, 0, 4555765.966137, 0, -164.762688]],
["vestfold.tif", [2301440, 32, 0, 495688, 0, -32]],
["wildfires.tiff", [-123.7412109375, 0.00439453125, 0, 42.29736328124999, 0, -0.00439453125]],
["wind_direction.tif", [140.8732174629773, 0.059625865061045724, 0, -27.985000227888424, 0, -0.050000001986821495]]
].forEach(([filename, expected]) => {
test(filename, async ({ eq }) => {
const tif = await fromFile("./data/" + filename);
const img = await tif.getImage();
const actual = Geotransform(img);
eq(actual, expected);
});
});