I have two separate cells in a Notebook: one that ...
# datascience
e
I have two separate cells in a Notebook: one that does some processing, and returns me a dataframe that contain some coordinates with some info. Another one that takes the GeoPolygon for a region. This is what I can draw: As you may have imagined, I want to combine them both. However, if I read the documentation of Geo Plotting properly, the only way to combine them is to transform the first dataframe into a GeoJSON object (several GeoPoints probably) and then overlap it into the map. Is there any other way that this can be done without having to convert the objects? I was hoping that the geomap() function could offer somehow a lambda that could be used to return points.
I am actually achieving this, as mentioned, by generating a GeoJSON file, but I think it would be easier to provide another API for that
a
Hi! Nice notebook and beautiful plots! Kandy has
withData()
extension for plot builder, that allows to override your plotting dataset. However, now there's a flaw - it doesn't work properly if you use for "geo plot"
GeoDataFrame.plot {}
. https://github.com/Kotlin/kandy/issues/480. But you still use
withData
in a common plot, something like this:
Copy code
filteredRides.plot {
    withData(munichArea) {
    geoMap() {
        fillColor = Color.LIGHT_BLUE
        borderLine {
            color = Color.PURPLE
            width = 1.5
        }
    }
    points {
        x("STARTLON") { axis.name = "Longitude" }
        y("STARTLAT") { axis.name = "Latitude" }
        color = Color.RED
        alpha = 0.5
    }
    points {
        x("ENDLON")
        y("ENDLAT")
        color = Color.BLUE
        alpha = 0.5
    }
    layout.title = "Geolocation of Start (Red) and End (Blue) Points"
}
e
Hi @Andrei Kislitsyn! Thanks for the heads-up. That’s a good solution, I was just trying the other way around. Thanks for the heads-up!