The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Getting started with deckglgeoarrow

deckglgeoarrow provides functions to quickly add layers to a mapgl::maplibregl() map.

Layers

Currently, the following add*Layer functions are available:

All layers accept one of three data related inputs:

In addition, mainly for developers, nanoarrow_array_streams are also supported.

Styles

For style customisation, all (Deck.gl) layers have two types of properties:

Additionally, popup(s) and tooltip(s) can be defined in various ways:

Similar to the style cusomisation mentioned above, popups and tooltips can be customised using popup_options via function popupOptions() and tooltip_options via function tooltipOptions()

Example

Putting this together, here’s example showing 1k points using addGeoarrowScatterplotLayer

library(mapgl)
library(deckglgeoarrow)
library(wk)

style_openfreemap = 'https://tiles.openfreemap.org/styles/liberty'

n = 1e3

pts = data.frame(
  id = 1:n
  , geometry = xy(
    x = runif(n, -180, 180)
    , y = runif(n, -90, 90)
    , crs = 4326
  )
)

pts$radius = sample.int(15, nrow(pts), replace = TRUE)
pts$fillColor = sample(hcl.colors(n, alpha = sample(seq(0, 1, length.out = n))))
pts$lineWidth = sample.int(5, nrow(pts), replace = TRUE)
pts$lineColor = sample(
  hcl.colors(n, alpha = sample(seq(0, 1, length.out = n)), palette = "inferno")
)

maplibre(style = style_openfreemap) |>
  addGeoArrowScatterplotLayer(
    data = pts
    , layer_id = "scatter"
    , geom_column_name = "geometry"
    , render_options = renderOptions(
      beforeId = "water"
    )
    , data_accessors = dataAccessors(
      getRadius = "radius"
      , getFillColor = "fillColor"
      , getLineWidth = "lineWidth"
      , getLineColor = "lineColor"
    )
    , popup = TRUE
    , popup_options = popupOptions(
      anchor = "bottom-right"
    )
    , tooltip = "id"
    , tooltip_options = tooltipOptions(
      anchor = "top-left"
      , closeOnMove = TRUE
    )
  ) |>
  add_navigation_control(visualize_pitch = TRUE) |>
  set_view(c(0, 0), 2) |>
  add_globe_control() |>
  add_layers_control(
    layers = list("Scatter Layer" = generateDeckglLayerId(
      layer_id = "scatter", beforeId = "water")
    )
  )

More examples can be found here.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.