-
Notifications
You must be signed in to change notification settings - Fork 219
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
Add gallery example for plotting geopandas.GeoDataFrame objects #1374
Comments
Assigning this issue to @Location-Artistry who's requested to work on this issue for the SciPy2021 sprint 😄 |
I played a little bit around with a dataset containing the road net of the US in shapefile format (TIGER/Line shapefiles). However, since the dataset is huge for the whole US I selected a subset containing only the road net of Hawai'i which is only around 2.5 MB (I made a zoom on O'ahu). I think this would be enough to generate a nice example which shows how we could use shapefile data loaded via geopandas in PyGMT. My only question is: how and where do we want to store data for generating the geopandas examples? |
We don't need to store it, it's possible to load the zipped shapefile data directly from the https url! import geopandas as gpd
gdf = gpd.read_file("http://www2.census.gov/geo/tiger/TIGER2015/PRISECROADS/tl_2015_15_prisecroads.zip")
print(gdf.head()) produces:
Alternatively, we can use the built-in datasets in geopandas using path = gpd.datasets.get_path('nybb')
gdf = gpd.read_file(path)
print(gdf.head())
|
Thanks @weiji14. I recognized that's it's possible to load the zipped shapefile data directly from the url, however, I thought the loading procedure takes too long. I added a PR addressing lines data in a geopandas.GeoDataFrame (#1474). Would suggest that this PR can serve as a starting point for new users which may add further examples using point and polygon data. |
@GenericMappingTools/pygmt-maintainers I feel a choropleth map, like in the EGU 2021 Short Course, would be a further nice gallery example showing how to plot geopnadas-GeoDataFrame objects, in this case how to plot polygons. |
I agree. It's likely that @michaelgrund is working on a similar example in which he had the issue #2497. |
Exactly, the issue came up while working on a gallery example which shows the usage of polygons. Will push the early stages in the next few days 😉 |
No worries 🙂. I did not work on a specific gallery example so far. But I saw that we do not have a choropleth map in the gallery (only in the Short Course, which is probably not so easy to find), when thinking about potential figures for the PyGMT paper. So @michaelgrund go ahead and submit a PR with your ideas 🚀. |
Description of the desired feature
It would be great to have some gallery examples on how users can plot geopandas.GeoDataFrame objects in PyGMT. This will be a follow up to #1000. You will need to have some familiarity with
geopandas
and/orPyGMT
, but if you're still keen to learn, let us know and we'll guide you along!Note that if you are interested in writing a full tutorial for geopandas inputs, see #1268.
Examples of what you can do
These are just suggestions of things that you can plot. Feel free to come up with other ideas, especially if you know of a cool dataset! See also https://geopandas.org/gallery/index.html for inspiration
How to make the change 🧐
Are you willing to help implement and maintain this feature? Happy to mentor someone to handle this task!
The text was updated successfully, but these errors were encountered: