Kotlin lets-plot: Draw a simple line between two geo locations defined by latitude and longitude

How do I use lets-plots geotools in Kotlin (ideally a Kotlin Notebook), to draw a line between two geo lat-long pairs?

For example:

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

// Visualize a line from brussels to paris

This works:

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

letsPlot(dataset) + geomPath() { x = "longitude"; y = "latitude" }

Leave a Comment