You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many users (including me) are running piplines and script using the GEE API in Python. In the wonderland of .py where IPython kernel is not available, there is no sign of bokhe, plotly, bqplot and other interactive options. In these desolated lands reigns a single master... 🥁: matplotlib
There also a bunch of Python developer (incluing me) that spend a decent amount of time learning and mastering matplotlib so it can be used in interactive context as well.
When dealing with GEE objects we currently have no non-interactive, client side options to draw the nice charts that are available in the code editor. So, I coded this WE some plotting capabilities in geetools extension. I started with the ee.FeatureCollection but I think the other objects should be done by the end of march.
What can you do ?
As a starter you can now extract data from a ee.FeatureCollection as a server-side ee.Dictionary either labeled by feature (byFeature):
Here is a small example from the documentation, all the options are displayed in the demo page so I hope to see you there!
# Import the example feature collection.ecoregions=ee.FeatureCollection('projects/google/charts_feature_example')
fig, ax=plt.subplots()
# initialize the plot with the ecoregions dataecoregions.geetools.plot_by_features(
type="bar",
featureId="label",
properties= ['01_tmean', '02_tmean', '03_tmean', '04_tmean', '05_tmean', '06_tmean', '07_tmean', '08_tmean', '09_tmean', '10_tmean', '11_tmean', '12_tmean'],
labels= ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"],
colors= ['#604791', '#1d6b99', '#39a8a7', '#0f8755', '#76b349', '#f0af07', '#e37d05', '#cf513e', '#96356f', '#724173', '#9c4f97', '#696969'],
ax=ax
)
# once created the axes can be modified as needed using pure matplotlib functionsax.set_title("Average Monthly Temperature by Ecoregion")
ax.set_xlabel("Ecoregion")
ax.set_ylabel("Temperature (°C)")
plt.show()
These new functions are available in the v1.3.0 of the lib. I of course know it's not sufficient but it's a start. By myself I cannot see all the edge cases, so if you want to join the adventure I'm looking for testers to provide feedback on the lib and these functions, happy to read your thoughts in our issue tracker!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
WE can plot
Context
Many users (including me) are running piplines and script using the GEE API in Python. In the wonderland of
.py
where IPython kernel is not available, there is no sign ofbokhe
,plotly
,bqplot
and other interactive options. In these desolated lands reigns a single master... 🥁:matplotlib
There also a bunch of Python developer (incluing me) that spend a decent amount of time learning and mastering matplotlib so it can be used in interactive context as well.
When dealing with GEE objects we currently have no non-interactive, client side options to draw the nice charts that are available in the code editor. So, I coded this WE some plotting capabilities in
geetools
extension. I started with theee.FeatureCollection
but I think the other objects should be done by the end of march.What can you do ?
As a starter you can now extract data from a
ee.FeatureCollection
as a server-sideee.Dictionary
either labeled by feature (byFeature
):Or by properties (
byProperty
):This is not particularly useful but that is the based data format fo all plots so I decided to expose them.
Then starts the intersting things, the plotting mechanisms. I created 3 client-side functions:
plot_by_properties
,plot_by_features
andplot_hist
.Here is a small example from the documentation, all the options are displayed in the demo page so I hope to see you there!
These new functions are available in the v1.3.0 of the lib. I of course know it's not sufficient but it's a start. By myself I cannot see all the edge cases, so if you want to join the adventure I'm looking for testers to provide feedback on the lib and these functions, happy to read your thoughts in our issue tracker!
Beta Was this translation helpful? Give feedback.
All reactions