Kotlin 让绘图:在由纬度和经度定义的两个地理位置之间绘制一条简单的线

问题描述 投票:0回答:1

如何在 Kotlin(最好是 Kotlin Notebook)中使用 let-plots 地理工具,在两个地理经纬度对之间画一条线?

例如:

val brussels = Pair(50.8427501, 4.3515499)
val paris = Pair(48.864716, 2.349014)

// Visualize a line from brussels to paris
kotlin geotools lets-plot kotlin-notebook
1个回答
0
投票

这有效:

val dataset = mapOf(
        "latitude" to listOf(50.8427501, 48.864716),
        "longitude" to listOf(4.3515499, 2.349014),
)

letsPlot(dataset) + geomPath() { x = "longitude"; y = "latitude" }
© www.soinside.com 2019 - 2024. All rights reserved.