Google Earth Engine in QGIS - QGIS GEE 01 | burdGIS
HTML-код
- Опубликовано: 1 авг 2024
- Did you read that title right? Yes, yes you did. The awesome power of Google Earth Engine right there in your QGIS desktop. I'm not clever enough to make that happen but Gennadii Donchyts and the GEE-community are. Here we look at how to install the plugin and start playing with Google Earth Engine datasets.
If you enjoyed this video you can support the channel and buy me a coffee using this link:
paypal.me/burdGIS
Be aware that cloud cover can affect NO2 readings in Sentinel5P data:
atmosphere.copernicus.eu/flaw...
You can find the plugin homepage here:
gee-community.github.io/qgis-...
And the geodose article here:
www.geodose.com/2019/12/googl...
🌐 Visit our site 🌐
www.burdgis.com
🌐 Take an online GIS course 🌐
www.udemy.com/course/an-intro...
🌐 Find us on facebook 🌐
/ burdgis
Use coinbase as the home for your crypto-currency:
www.coinbase.com/join/5c6d098...
Thanks buddy. I was just starting to explore GEE plugin for QGIS and this happens to be a good start. Cheers!!!!
Glad it helped!
Great video. I like how you are teaching us how to use the docs.
It's where you find all the best tips 😀
earth engine project is a brilliant project that Google company publicize it and that plugin did a great job by connecting QGIS and GEE together :D thx for share this video .
No problem. Thank the developers, I'm just the messenger 😀
love you so much!! high quality contents
Thank you! 🙂
Thanks you so much you videos are very educative simple and straight forward
Thanks Charles! I'm glad it was useful
Thanks a lot for making this video! :-)
Thanks for making the plugin! 🙂
Excellent Thanks from South Africa
Glad it helped you Ewan
What a great presentation
Thanks Modou, glad you liked it :-)
Thanks, burdGIS!!!
You're welcome Maria :-)
Looks interesting!
Thanks Sam. :-)
Hi! I was wondering if there's a way to load an image collection. For example, I need to load 1 year of Sentinel imagery for one tile to get the reflectance values from certain points. I find it easier sampling the points using QGIS rather than coding in GEE, but when I try adding the image collection (with all the necessary filters aplied) I only get one gray polygon of the corresponding tile.
Thanks for the question Carlos. Can you share the code you have so far?
I think it would have helped in the description and the voice over if we the end user knew we had to have a google earth engine specific account so as not find this exercise awkward or is that part of a subliminal test of the users?
Thanks for the suggestion Terence. I'm glad you worked it out. More subliminal tests to follow :-)
You videos are extremely good and useful. Thank you for the videos and your effort.
Could you please put up a tutorial for river basin delineation in QGIS using HydroSHEDS dataset and Sentinel-1 ? How to calculate MNDWI in Sentinel-1 and 2 (In Sentinel-2, the concerned bands have different resolution). Your channel will be the first to show how to integrate EE/QGIS/Python for hydrology.
Thanks deeps. It sounds like you have the workflow planned out. Have you tried this yourself? Where are you having problems?
@@burdGIS I am a CS professional venturing into the geo spatial world. I taught myself QGIS during the lockdown. I recently came across Earth Engine and became very interested in it. While looking for tutorials/slides, I came across your youtube channel.
The whole world of RS is new to me and is a bit of a steep learning curve, along with GEE! But, I am inching my way forward. I thought of delineating a river basin. I was able to make progress using Sentinel 2 and NDWI. But don't understand how to calculate MNDWI.
My goal is to export the image to QGIS and do the delineation there. I understand that you need a DEM. I don't understand how to use it with HydroSHEDS and Sentinel 2.
I was therefore looking and hoping for some tutorials on this - start with EE and finish in QGIS.
I could share my EE code (with Sentinel 2 only) with you.
Please do! Is it in javascript?
@@burdGIS Yes. Email id?
Someone know why the icon identify features does not work in qgis with the plugin earth engine?
The plugin works by bringing in a wms of the data. This really just shows the colour rather than the actual values. (AFAIK)
@@burdGIS Thank you. That sounds logic. Another question, Do you know why I can Export a Geotif to my Drive from Qgis using the plugin? I used the following code:
### export all features in a FeatureCollection as one file
taskParams = {
'driveFolder': 'CCRRDonana_2020',
'fileFormat': 'CSV' # CSV, KMZ, GeoJSON
}
task = ee.batch.Export.table.toDrive(ndvi_15_mean, 'ndvi_15_mean', **taskParams)
task.start()
But not happen nothing in drive and any errors is shown. Thanks in advance
Although it works of the python earth engine API I'm not sure all commands will work. Is there any mention of saving to drive on the plugin page?
Thanks burdGIS for this awesome video. I am getting an error after passing the authorization token to QGIS. the error massage was "couldn't load plugin 'ee_plugin' due to an error when calling it's classFactory () method. Any suggestions will be appreciated
BTW I'm using version 3.12 of qgis
Thanks Fahad. Are you using a Mac? Check the github repo for the plugin as I think an issue with Mac authentication is raised there
burdGIS , No, I am actually using windows
I keep getting an error that starts with "Couldn't load plugin 'ee_plugin' due to an error when calling its classFactory() method
", any help video on fixing this?
Thanks G. What version of Q, the ee plugin and operating system / machine are you using? Have you checked the github issues page to see if anyone else has this issue? Have you tried reinstalling the plugin on different versions of QGIS? Let me know how you get on! :-)
@@burdGIS Using a 64bit windows 10, QGIS versions 3.141-1 and 3.14.15-1, and tried reinstalling plugin multiple time for each version. I did find some people with same issues but the fixes starts using tech language way out of my understanding level, hence I was hoping to find a video to take me step by step. I will take a closer look at github and see if I can find a clearer solution. Thanks for quick replay.
No problem G. Can you point me in the direction of some of the "tech language" answers you've found already? I might be able to help decode it ;-)
@@burdGIS First I found this post which I think is the same (similar) problem. github.com/gee-community/qgis-earthengine-plugin/issues/51. My error a bit different as I dont ever get the the "paste the authentication code into the verification box" step, the top line in my error states "TypeError: get_authorization_url() missing 1 required positional argument: 'code_challenge'" so I assume it something to do with authorization, so I clicked on the link in the above post, github.com/gee-community/qgis-earthengine-plugin#faq, and now I am completely lost. Just so you know I do have have google earth pro installed and working on my computer (so I do have an account set up). Basically I get lost when I need to deal with scripts and such. Thanks.
Thanks G. Google Earth Pro and Google Earth Engine are different. You will need a specific Google Earth Engine account for this plugin to work. You should be able to sign up here:
earthengine.google.com/new_signup/
I have a problem with the authentication
It keeps giving me the error below after pasting the code
Couldn't load plugin 'ee_plugin' due to an error when calling its classFactory() method
urllib.error.URLError:
Traceback (most recent call last):
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin/ee/data.py", line 218, in get_persistent_credentials
tokens = json.load(open(oauth.get_credentials_path()))
FileNotFoundError: [Errno 2] No such file or directory: '/Users/air/.config/earthengine/credentials'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/ee_auth.py", line 19, in init
ee.Initialize()
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin/ee/__init__.py", line 112, in Initialize
credentials = data.get_persistent_credentials()
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin/ee/data.py", line 229, in get_persistent_credentials
'Please authorize access to your Earth Engine account by '
ee.ee_exception.EEException: Please authorize access to your Earth Engine account by running
earthengine authenticate
in your command line, and then retry.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/urllib/request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/http/client.py", line 1392, in connect
server_hostname=server_hostname)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/ssl.py", line 412, in wrap_socket
session=session
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/ssl.py", line 853, in _create
self.do_handshake()
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 334, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 25, in classFactory
from .ee_plugin import GoogleEarthEnginePlugin
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 737, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/ee_plugin.py", line 26, in
ee_plugin.ee_auth.init()
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/ee_auth.py", line 21, in init
authenticate()
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/ee_auth.py", line 48, in authenticate
ee.oauth._obtain_and_write_token(token.strip())
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin/ee/oauth.py", line 128, in _obtain_and_write_token
token = request_token(auth_code)
File "/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin/ee/oauth.py", line 79, in request_token
parse.urlencode(request_args).encode()).read().decode()
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/urllib/request.py", line 1360, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError:
Python version: 3.7.3 (default, Mar 27 2019, 09:23:15) [Clang 10.0.1 (clang-1001.0.46.3)]
QGIS version: 3.10.0-A Coruña A Coruña, 6c816b4204
Python Path:
/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python
/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins
/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages/geos
/Applications/QGIS3.10.app/Contents/Resources/python
/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages
/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/lib-dynload
/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python37.zip
/Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7
/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin
/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/midvatten
/Users/air/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/midvatten/tools
Thanks Moses. Including the log was veyr helpful. I haven't had a chance to test this on a Mac which I see you're using. However, there looks to be an issue raised here:
github.com/gee-community/qgis-earthengine-plugin/issues/39
Please try the solutions there and let me know how you get on.
If you could find a solution for it I would be much appreciative. Thanks very much for the timely reply
Hi Moses, have you tried any of the solutions in the issues link I posted? I'm afraid I don't have access to a Mac and will not have for... who knows how long at the moment.
burdGIS I have tried all the solutions mentioned but none of them work. It is still giving me the same error and I don’t know why.
@@moseskolleh I had the same problem. I'm using QGIS version 3.12.2. This is what I did to fix it. I made sure my python default is set to version 3.6.0 since the plugin works with that. I did that with "PYENV". After that, I navigated to the folder with the "credentials" file, duplicated the file, deleted the original, and renamed the duplicate to the exact filename of the original file. And that was it. Please make sure you have an account with google earth engine first and be sure the account is active before trying it in QGIS. All the best.
How to authenticate the google earth engine ?
Hi rohit. You should be taken to a website to find your code. If you're not finding that please check the github page for issues. Also are you on a mac or windows?
@@burdGIS authentication is done sir but the ee.initialization() throughing an exception EEException: Permission denied. how to fix that?
I'm not sure Rohit. Have you put the error message into a search engine and checked the Github issues page? Also please let me know if you are on a Mac or Windows machine.
@@burdGIS on windows
@@burdGIS Can i mail that error exception text file ?