Closed dragonDaddy2012 closed 5 years ago
hi @dragonDaddy2012, there are 4 current issues (#41 #40 #33 ) with the same error message when initialising the ee package and that HTTP code 404....I'm not sure at the moment what can be going wrong as it works fine on my coastsat environment but I am sure that this can be fixed easily.
(for the spyder error "No module named coastsat", this is because you are not in the correct directory. You can navigate through directories on the top right panel of spyder
But this will not solve the second error with HTTP code 404. To debug this issue, could you please try the type the following commands on the anaconda prompt:
conda activate coastsat
python
import ee
-ee.Initialize()
This should prompt the same error. To fix this I propose you remove the coastsat environment already installed (conda env remove --name coastsat
and then conda clean --all
) and re-install a new one with more updated versions of the packages.
The you can open the environment.yml file with a text editor and replace its content with the following:
channels:
- defaults
- conda-forge
dependencies:
- python=3.7
- matplotlib
- earthengine-api
- gdal
- geopandas
- pytz
- scikit-image
- scikit-learn
- shapely
- spyder
- notebook
Then run conda env create -f environment.yml -n coastsat
again and install the new environment. This should fix the issue, let me know. Cheers, Kilian
hi @dragonDaddy2012, there are 4 current issues (#41 #40 #33 ) with the same error message when initialising the ee package and that HTTP code 404....I'm not sure at the moment what can be going wrong as it works fine on my coastsat environment but I am sure that this can be fixed easily. (for the spyder error "No module named coastsat", this is because you are not in the correct directory. You can navigate through directories on the top right panel of spyder and go to the directory that contains the /coastsat folder)
But this will not solve the second error with HTTP code 404. To debug this issue, could you please try the type the following commands on the anaconda prompt:
* `conda activate coastsat` * `python` * `import ee` -`ee.Initialize()`
This should prompt the same error. To fix this I propose you remove the coastsat environment already installed (
conda env remove --name coastsat
and thenconda clean --all
) and re-install a new one with more updated versions of the packages. The you can open the environment.yml file with a text editor and replace its content with the following:channels: - defaults - conda-forge dependencies: - python=3.7 - matplotlib - earthengine-api - gdal - geopandas - pytz - scikit-image - scikit-learn - shapely - spyder - notebook
Then run
conda env create -f environment.yml -n coastsat
again and install the new environment. This should fix the issue, let me know. Cheers, Kilian
I think I discovered the 404 error. Google manual approves account requests to access the images. I have put the request in and will re-attempt upon approval. I will navigate to the directory as well and see how that works.
did you get it working?
Did you link your credentials with earthengine authenticate
? you may need a Google account for this
Hello @kvos , Still awaiting approval by Google for Earth Engine. Please see earlier reply [Google manually approves]. I will let you know once I get approval :)
Ok thanks for the info, this must be new because we never had to wait for approval from google before
@kvos ,
got access - so, making progress. However, now we are getting stalled at:
output = SDS_shoreline.extract_shorelines(metadata, settings)
Error Message:
File "./CoastSat-master/coastsat/SDS_shoreline.py", line 525, in show_detection
mng.window.showMaximized()
**AttributeError: 'FigureManagerBase' object has no attribute 'window'**
Running "example.py", changed the following:
polygon = [[[12.7408410319,45.5212666771],
[12.7264214762,45.5381024608 ],
[12.839717985,45.5984293404],
[12.8737069376,45.5753637629],
[12.7408410319,45.5212666771]]]
To see the full edited "example.py" and the data-specific pulls, please see the temp repo: https://github.com/dragonDaddy2012/CoastSat_Linked
ok @dragonDaddy2012 I think this is an easy fix...in Spyder go under Preferences>IPython console> Graphics andchange the Grapgics Backend to Automatic (instead of Inline), then restart Spyder. This will make the figures interactive and solve that issue.
By the way, could you shortly describe the process of getting access to GEE as I think other users are having the same problem, thanks
@kvos That seemed to have worked (it does, on the example.py). However, I have tried two sets of polygons, and in both instances, get the following error:
metadata = SDS_download.retrieve_images(inputs)
Downloading images:
Traceback (most recent call last):
File "<ipython-input-3-81739100d1f3>", line 1, in <module>
metadata = SDS_download.retrieve_images(inputs)
File "/CoastSat-master/coastsat/SDS_download.py", line 538, in retrieve_images
utm_zone_selected = np.max(np.unique(utm_zones))
File "/anaconda3/envs/coastsat/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 2505, in amax
initial=initial)
File "/anaconda3/envs/coastsat/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity
(I will post actual script on same temp repo).
Regarding GEE, I'd be happy to describe:
You need to register for GEE via the GEE portal: https://signup.earthengine.google.com. This is free, however, you will need to provide some details (e.g. What you plan on using GEE for, etc.).
Google manually approves GEE requests as they are received. Once the form is submitted, Google will process and send a confirmation email. After approval, you will receive another email notification. That simple!
I just had a look at your script and it looks like you have inverted longitudes and latitudes. Thanks for describing the process, I have now added this to the documentation
closing this issue as it is solved
Followed the README: created new env and activated 'coastsat' via .yml tried in both Jupyter and Spyder, continue to get error when attempting to import the required scripts from 'coastsat'
from coastsat import SDS_download, SDS_preprocess, SDS_shoreline, SDS_tools, SDS_transects
"No module named coastsat"
When running via jupyter:
EEException: Server returned HTTP code: 404