Add webMercator absolute coordinates test

This commit is contained in:
Alexander Nozik 2022-06-17 17:55:01 +03:00
parent b679a43b6f
commit 3910b22504
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357

View File

@ -47,4 +47,12 @@ class MercatorTest {
assertTrue { offset.y in -127.0..128.0 } assertTrue { offset.y in -127.0..128.0 }
assertTrue { offset.zoom > 0.0 } assertTrue { offset.zoom > 0.0 }
} }
@Test
fun webMercatorAbsolute() {
val mskCoordinates = GeodeticCoordinates.ofDegrees(55.7558, 37.6173)
val wmc = with(WebMercatorAlgebra) { mskCoordinates.toMercator(13.0) }
assertEquals(wmc.x, 1267712.0, 50.0)
assertEquals(wmc.y, 655616.0, 50.0)
}
} }