-
Notifications
You must be signed in to change notification settings - Fork 413
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
Plotting geoJSON and shapefiles #1945
Comments
This would be great functionality to MetPy and the declarative plotting interface. We do currently use shapefiles for Thinking a little bit about implementation, the way most of our declarative interface works, the reading happens independent of plotting, so we would not necessarily add a hard dependency on Geopandas (which looking at their dependencies only adds Fiona beyond what we already use), but that could be an initial format we accept for plotting. Would it be useful to think about how we could support other object types for being able to plot shapefiles and GeoJSON data? Anyway, would love to see this as I only see the availability of forecast and other data increasing in these formats and wanting a nice way to plot them up with other meteorological data. |
It would be interesting to add support to declarative (if we can do it without making the implementation too ugly). The way I've usually added something like this to MetPy in the past is to first put together a full demo and then look to see what the hard/lengthy parts are and look at standardizing those in MetPy. So @23ccozad if you'd like to put together a demo notebook (that could end up on the training site), we can use that as a starting point to identify what MetPy could actually help with. |
Thanks for the feedback! I'll work on a demo notebook over the next few days and see what I can come up with. |
Here is a demo notebook I've put together for a new class in declarative that plots GeoJSON/shapefile: This is definitely still a draft, so I'll be interested in seeing what areas you all think could be improved. |
My first reaction is - Wow! This looks great as a first pass and much better than anything I could have done. In addition to plotting some of these meteorologically specific polygons/lines, I see this as a potential to an expanded capability to add "layers" to any map in addition to what is incorporated into the The only think I noticed on quick glance is related to the The only thing I am thinking that could be added is to have a bit more control over the label color separately from the geometry color. Using the geometry color by default, but then having the option to set The examples that you plotted are excellent and some of the most common that would be used within the field. I assume this should also work with other shapefiles (e.g., roads, locations, etc.). It would be good to make sure that at least some of those common elements would also plot well in this scheme. I don't know if any of these are available remotely like the NHC and SPC examples, but "should" be able to be loaded locally with the files saved in zip format. |
Thanks for the detailed comments, @kgoebber! I went ahead and updated the gist to add Next steps at this point will be adding docs and tests for the class, open a PR, and then go from there. |
As we move towards plotting WPC fronts (#1153), I'm wondering if there would be interest in plotting other various forecast products made available as geoJSON and shapefiles, potentially as part of the declarative interface. For example, the Storm Prediction center provides its convective outlooks in geoJSON format. The National Hurricane Center also provides a number of products as shapefiles.
https://www.spc.noaa.gov/gis/
https://www.nhc.noaa.gov/gis/
Behind the scenes, we could have geopandas read these files into GeoDataFrames, which Cartopy can then plot. I'm also thinking that users could pass in columns from which Cartopy can grab fill colors and/or stroke colors for each of the polygons/lines/points being plotted.
I toyed around with some of this mapping today and got some cool results. I could see it being very practical to combine these products with contour or barb plots of other variables as a way to supplement a weather analysis. Interested to hear what thoughts there are on this.
The text was updated successfully, but these errors were encountered: