This looks like a great package of nice tools! As I'm working more and more with DwC data, either during reformatting or extracting using pyobis, I find myself rewriting this little bit of code in all my notebooks to make a simple map of observations. It got me thinking, is this something that would be appropriate to be added to this package?
Something like py-dwc-viz.dwc_make_map(DataFrame)
, where DataFrame contains decimalLongitude
and decimalLatitude
, at a minimum.
import matplotlib.pyplot as plt
import geopandas as gpd
# read into geopandas dataframe for plotting
gdf = gpd.GeoDataFrame(
df,
geometry=gpd.points_from_xy(df.decimalLongitude, df.decimalLatitude),
crs = "epsg:4326",
)
fig, ax = plt.subplots(figsize=(20,10))
gdf.plot(ax=ax, markersize=5, zorder=10, legend=True)
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world = world.to_crs(gdf.crs)
world.plot(ax=ax, color='lightgrey', edgecolor='white', zorder=1)
ax.set_axis_off()
plt.show()