Happy Mapdeck!

Those of you who follow @SymbolixAU will have no doubt seen various tweets of all the updates I've been adding into Mapdeck. So I've decided to set myself the goal of getting v0.2 released by Christmas day:

madpeck_v0_2_0.png

(or at least submitted to CRAN by then)


rewrite_code.jpeg

So - what's new?

Everything!

I've re-written all the underlying R code, created three new libraries

and updated 2 others

so that all the data processing and manipulation is handled at the C++ level.

The exception to this rewrite is the R API - as a user you should see minimal changes to the code you need to write to ues it (apart from add_geojson(), I've had to change this slightly). Sorry.

What does this mean for me?

As well as performance improvements, like this example of reducing a 60-second plot to 3 seconds, you can also use one of the new features, such as...

Transitions

You can make shapes transition smoothly between states

polygon_transitions.gif

Auto-centering on layer

When you plot data the map will auto-zoom to your layer, so you don't have to specify the location argument

## Old
mapdeck( location = c(144.9, -37.8), zoom = 6) %>%
  add_path( data = roads )

## new
mapdeck() %>%
  add_path( data = roads )

add_sf

The function add_sf() is a convenience function, designed for when you don't really know what's inside your sf object. It will plot any sf object by calling the appropriate plotting function on your behalf.

  • sf POINTS - add_scatterplot()
  • sf LINESTRINGS - add_path()
  • sf POLYGONS - add_polygon()
  • sf GEOMETRY - add_geojson()

GeoJSON

I've given the user more control on how GeoJSON can be plotted, and the function arguments now match the other layers. This is so when using add_sf( data = sf, fill_colour = "myCol"), the fill_colour gets propogated to the add_geojson() layer, etc.

Seems like everything's done then?

Yeah....nah!

My v1.0 list is ever expanding:

mapdeck_v1.png

and the people working on Deck.gl add features at an alarming rate, so I need to keep up with them too.

Lots more to come!