Hi,
This isn't intended to be a ready-to-use pull request - more to let you have a look at what I've
been testing.
The original problem that lead me to think about this was using multiple mappings for single object
types - e.g. roads might have a group membership, corresponding to colour, and a continuous
measure, such as traffic load, speed limit, etc, that should be displayed as either size or
transparency. In principle an easy problem in ggplot2.
So, I've done some playing around with the more "traditional" ggplot2 approach. It turns out that the stars have aligned and most of the pieces are already in place. These are:
a geom_sf in the development version of ggplot2
lots of tidyverse verbs supported by the sf package, and the fact that sf uses special data frames.
There are two files in this PR - a Rmd and the supporting R code. No nice formatting or thorough testing, just a demo of ideas.
Notes - the ggplot2 support for sf is preliminary, and there are issues around where things like
xlim get set. These are different to how osmplotr is currently set up, and may be annoying.
sf gives lots of warnings about the assumptions it makes. I haven't attempted to turn them off.
Hi, This isn't intended to be a ready-to-use pull request - more to let you have a look at what I've been testing.
The original problem that lead me to think about this was using multiple mappings for single object types - e.g. roads might have a group membership, corresponding to colour, and a continuous measure, such as traffic load, speed limit, etc, that should be displayed as either size or transparency. In principle an easy problem in ggplot2.
So, I've done some playing around with the more "traditional" ggplot2 approach. It turns out that the stars have aligned and most of the pieces are already in place. These are:
geom_sf
in the development version of ggplot2There are two files in this PR - a Rmd and the supporting R code. No nice formatting or thorough testing, just a demo of ideas.
Notes - the ggplot2 support for sf is preliminary, and there are issues around where things like xlim get set. These are different to how osmplotr is currently set up, and may be annoying.
sf gives lots of warnings about the assumptions it makes. I haven't attempted to turn them off.
Enjoy!