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

Include geodatasets example in geom_map reference page #794

Open
machow opened this issue May 30, 2024 · 0 comments
Open

Include geodatasets example in geom_map reference page #794

machow opened this issue May 30, 2024 · 0 comments

Comments

@machow
Copy link
Contributor

machow commented May 30, 2024

Around the end of 2023, it looks like a nice package called geodatasets was released, and is used throughout geopandas tutorials (e.g. this one).

It could be helpful to have an example in geom_map that uses geodatasets. This way, people can use the same data as in geopandas tutorials, and get started quickly with fetching shapefiles.

Here's a plot I made based off the geopandas tutorial, which was helpful to see:

import geopandas as gp
import geodatasets

chicago = gp.read_file(geodatasets.get_path("geoda.chicago_commpop"))
groceries = gp.read_file(geodatasets.get_path("geoda.groceries"))

(
    ggplot()
    + geom_map(data=chicago, fill=None)
    + geom_map(data=groceries.to_crs(chicago.crs), color="green")
    + theme_void()
    + coord_fixed()
)
image
(
    ggplot(chicago, aes(fill="POP2010"))
    + geom_map() 
    + coord_fixed()
    + scale_fill_cmap('plasma')
)
image
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

2 participants