-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve glider track map #166
Comments
A brief outline of a dynamic folium map import folium
import geopandas as gpd
df = ds.to_pandas()[["LONGITUDE", "LATITUDE", "DIVE_NUM"]].groupby("DIVE_NUM").median()
gdf = gpd.GeoDataFrame(
df, geometry=gpd.points_from_xy(df.LONGITUDE, df.LATITUDE), crs="EPSG:4326"
)
# OpenStreetMap
map = folium.Map(location=[df.LATITUDE.mean(), df.LONGITUDE.mean()], tiles="OpenStreetMap", zoom_start=8)
folium.GeoJson(
data=gdf["geometry"],
).add_to(map)
map |
This will be a lot more flexible than the static cartopy map but it requires more heavy packages and obvs will not work with the pdf summary sheets. Not certain if it's something worth supporting. But I think interactive plots have a lot of advantages... |
I really like it! And we could have it in the demo and keep somehow the old one for the pdf or can we get a static out of this one for the pdf? |
I think for notebooks these dynamic plots definitely make more sense (see also use of bokeh in IOOS QARTOD for interactive plots of qc flags https://github.com/ioos/ioos_qc/blob/main/docs/source/examples/QartodTestExample_Glider.ipynb) We should have a real think of how to provide these interactive plots though. As they will only work in notebooks not reports and can be quite fragile. I would probably put all these interactive plots in a seperate module. Maybe a folder structure like
|
I think this speaks to maybe the two divergent use cases of |
I think having both options int the separate codes is a good idea. You have a fair point with the purpose of glidertest and then how relevant or not the interactive plots are. This is something we can def discuss when you are here next week |
May be worth discussing whether this is beyond the scope of glidertest. I could see some arguments both ways. Against fancy/heavy visualisation: For fancy visualisation: Solutions-- Or alternatively, we could consider a fully-separate package of gliderviz which could be used alongside glidertest. Annoying thing there--you wouldn't be able to use it to replace the plotting within glidertest, unless you also require the user to install it, in which case you haven't circumvented the problem of package management (A1), but does keep glidertest closely aligned to the main purpose.. I haven't come across |
I think the question of scope is a good one. The primary focus of glidertest must remain bulk evaluation/automated detection of data issues. There are good options for making it an optional requirement. One is to use Python's optional dependencies to add geopandas, folium etc. So a user would do Or, as you say, we can make the interactive plotting a fully separate package. Good things to discuss on Friday! |
Currently it is a bit hard to work with the glider track map (as any map really), especially when adding it to existing figures
The text was updated successfully, but these errors were encountered: