I'm creating a GUI in Python for a Google Earth Engine Application and this is the result so far.

enter image description here

I can't figure out how to insert the map generated by Google Earth Engine into the grey area in the picture, that is a canva into the root window.

Is there a method to do this (and to do this only when the button is pressed)?

  • I dropped a comment on the answer, and of course it was taken away, I know the politic, it's fine. So I tell you here @AntonioTandoi, good job =) Another approach you can make is using Kivy, since it has a mapview extension that you could use – Rodrigo E. Principe Sep 24 '19 at 0:06

I've been working with the Python API for long, and tried to use the mapclient module it has, but Google Developers did that first approach and then dropped it (I could find some links related to that if you need). I don't think there is a way you can just "insert the map". You'll have to code it yourself. You could start with mapclient.py, but I can ensure you it's a complex task, you'll have to deal with threading, workers, etc. Maybe if you tell us where do you want to get or what do you want to do with it, we can recommend you an alternative. I made a package to use in Jupyter that uses ipyleaflet to handle the Map part, and uses pygal for charts (I think it's the same you are using in your application).

EDIT: You could try using Kivy, it's a great UI framework for Python that can even compile for Android and iOS. I've think on doing it, but I don't have the time to do it. It has a code input widget and a mapview

| improve this answer | |
  • Thank you so much for the response, Rodrigo. So, the aim of my project is to recognize irrigated areas into a given ROI. I'm building a simple desktop GUI where the user can choose the coordinates and the interval of observation. Then, after submitted these inputs, my original idea was plot the Earth Engine Map into that grey canva over there and plot also the NDVI chart nex to it (by the way, thank you for ipygee module). So you told me there isn't a way to do this. There's an alternative to plot the map inside there? – Antonio Tandoi Sep 24 '19 at 7:22
  • 1
    Hi @AntonioTandoi, I don't thinnk there is an alternative to put the map over there, as I said in my answer I think you have to code it yourself. Can't you make an app using the JavaScript API and the code editor? – Rodrigo E. Principe Sep 24 '19 at 11:05
  • No, because it was a task assigned by my professor, with the condition of Python. Thanks for the response anyway, I will think to some alternative solutions to get the point anyway. Maybe, for instance, to take a screenshot of the Earth Engine Map plotted separately and the put the screen inside the canva. – Antonio Tandoi Sep 24 '19 at 11:26
  • 1
    I though you needed an interactive map. In case you just need an image, there is a much easier way, use ee.Image.getThumbURL – Rodrigo E. Principe Sep 24 '19 at 11:43
  • Thank you. Indeed, I needed an interactive map, but since it's impossibile, I'll try with a single image. – Antonio Tandoi Sep 24 '19 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.