Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps – tmap, leaflet, sf, spdplyr, cartography, etc. #1

Closed
briatte opened this issue Dec 20, 2016 · 14 comments
Closed

Maps – tmap, leaflet, sf, spdplyr, cartography, etc. #1

briatte opened this issue Dec 20, 2016 · 14 comments

Comments

@briatte briatte added the TODO label Dec 20, 2016
@briatte briatte self-assigned this Dec 20, 2016
@briatte briatte changed the title TODO: Maps with tmap + spdplyr Maps with tmap + spdplyr Dec 20, 2016
@joelgombin joelgombin self-assigned this Dec 20, 2016
@briatte briatte changed the title Maps with tmap + spdplyr Maps with tmap + sf + spdplyr + cartography + … Dec 31, 2016
@briatte briatte changed the title Maps with tmap + sf + spdplyr + cartography + … Maps: tmap, leaflet, sf, spdplyr, cartography, … Dec 31, 2016
@briatte
Copy link
Owner Author

briatte commented Dec 31, 2016

The easiest solution might be to teach only one method, possibly one that works with both choropleths and geocoded points.

Pinging @rCarto in case he might have some suggestions.

@joelgombin
Copy link
Collaborator

IMHO the packages you're mentionning are dealing with very different tasks (as the rspatial discussion makes it clear), using very different paradigms and operating at vastly different levels of maturity.

So I think in the context of an introductory workshop to R, it is important to focus on 1/ a more-or-less coherent paradigm 2/ stable solutions 3/ one of the steps of the workflow @tim-salabim identified.

My advice at this point would be to focus on the rgdal/sp tools to import and contain data, as this is definitely what's most mature at the time. sf is very, very promising but definitely lacks real-worl use-cases at the time, and doesn't allow mapping without converting back to a Spatial* class. Also, spdplyr fits in nicely here.

Then you have two great mapping packages IMHO, cartography and tmap. My personal opinion is that ggplot2 is not really the way forward for mapping, but I know a lot of people, including you, would disagree. The advantage of using ggplot is that students can learn and use a coherent syntax. Now tmap uses a syntax that is not so different, and offers in my opinion a much wider range of possibilities. cartography is also great, because it's made by great geographers, and also have documentation in French (I have to say documentation is definitely one of the cons of tmap at the moment).

@briatte
Copy link
Owner Author

briatte commented Dec 31, 2016

I agree that the cited packages are different and unequally advanced.

More thinking aloud below. Basically, to me, there's three choices (leaving Leaflet out).

  1. Tinkering with ggplot2 + helpers. spbabel and spdplyr are ultra-interesting to me. I've briefly exchanged with @mdsumner on Twitter, and read his notes: he is making a lot of progress on releasing "tidy spatial" code. He has also released ggpolypath, which ggspatial is based upon.

    All these tools are nice, but as far as I can tell, none of them are stable. They help ggplot2 deal with spatial data (as does ggalt by improving on coordinates handling), but they help "from the outside". Helping "from the inside" would mean altering/re-thinking many of the ggplot2 fundamentals (my blog notes contain some hints about that).

    I hope that, at some point, all these tools will get bundled together in some nice way. For now, the ggplot2 microverse has ggmap and geom_map, and basic polygon fortifying (apparently with some bugs here and there). That's good enough for many, many basic cases of drawing maps.

  2. Keeping an eye on sf. I hope for geom_sf at some point. It's in the works, but it's at stage 1 out of 10 right now.

  3. cartography and tmap. Both of them look like good choices. The tmap syntax has my preference, because it "feels" tidy. But again: at least 75% of the tmap vignette can be done in ggplot2, and that's a plus if you are teaching a syntax with the hope that it will serve in many circumstances.

@mdsumner
Copy link

I can help you ggplot with sf already, if needed. It's good for learning if nothing else.

@briatte
Copy link
Owner Author

briatte commented Jan 9, 2017

Hi @mdsumner

Thanks for offering to help.

If you look at the draft syllabus, there is a section on data visualization.

I would like to include a single exercise involving maps, ideally using GADM and involving both choropleths and a 'bubble map' or something like that.

My guess is that the exercise would start with ggplot2/ggmap and then switch to something more appropriate for spatial data.

Here are some candidates for the exercise:

Feel free to chime in if you have suggestions for the exercise :)

Cheers,

ƒ

@briatte
Copy link
Owner Author

briatte commented Jan 9, 2017

P.S. @joelgombin and @rCarto are naturally welcome to submit ideas too!

@mdsumner
Copy link

mdsumner commented Jan 9, 2017

geom_sf is already here in the dev ggplot2: https://github.com/tidyverse/ggplot2/tree/sf

and dev mapview and now leaflet also supports sf: rstudio/leaflet#350

So it will be pretty easy to use, unless you need to teach before those updates are released to CRAN. I probably won't get to explore those links but feel free to ask specific questions.

@briatte
Copy link
Owner Author

briatte commented Jan 9, 2017

https://github.com/tidyverse/ggplot2/tree/sf

This rocks, I'll explore and see if I can teach with that (the workshop starts in February).

@briatte
Copy link
Owner Author

briatte commented Jan 11, 2017

This looks like a map that I'd be happy to reproduce with R:

https://visionscarto.net/global-nuclear-power-database

I'm posting some other suggestions in the other issues of this repo.

@briatte briatte changed the title Maps: tmap, leaflet, sf, spdplyr, cartography, … Maps – tmap, leaflet, sf, spdplyr, cartography, etc. Jan 11, 2017
@rCarto
Copy link

rCarto commented Jan 11, 2017

Well, I may have some ideas on how to reproduce this map. I'll let you know if I managed to.

@briatte
Copy link
Owner Author

briatte commented Jan 12, 2017

Many thanks!

@briatte
Copy link
Owner Author

briatte commented Jan 15, 2017

The conversation over at tim-salabim/rspatial/issues/9 is getting somewhere.

@edzer just posted a detailed text that links to

and all the other relevant places to monitor.

The rspatial.org website (which still has a few work-in-progress missing sections) has nice examples of using spplot from sp/raster.

@edzer has also written a very nice list of sp demos:

… and is continuing the work on sf – 2017 update:

@briatte
Copy link
Owner Author

briatte commented Jan 15, 2017

Last thing: the new repo to watch for discussions is r-spatial/discuss.

@briatte briatte added this to the 2023-v1 milestone Feb 15, 2023
@briatte briatte added the maps label Feb 25, 2023
@briatte
Copy link
Owner Author

briatte commented Apr 25, 2023

Replaced by #30

@briatte briatte closed this as completed Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants