Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ee.Geometry.Point does not accept varargs after importing eemont #67

Open
FeiYao-Edinburgh opened this issue Apr 26, 2022 · 4 comments
Open
Labels
bug Something isn't working

Comments

@FeiYao-Edinburgh
Copy link

FeiYao-Edinburgh commented Apr 26, 2022

Hi @davemlz !

I just found a VERY weird behavior in eemont 0.2.5. Before importing the eemont, the following code excerpt works perfectly:

import ee
ee.Initialize()

image = ee.ImageCollection("COPERNICUS/S2_SR").first().set("lon",5.9053, "lat",31.6585)

poi = ee.Geometry.Point([image.getNumber("lon"), image.getNumber("lat")]) # A list of two [x,y] coordinates.
print(poi.getInfo())

poi = ee.Geometry.Point(image.getNumber("lon"), image.getNumber("lat")) # varargs.
print(poi.getInfo())

>>>
{'type': 'Point', 'coordinates': [5.9053, 31.6585]}
{'type': 'Point', 'coordinates': [5.9053, 31.6585]}

However, after importing eemont, the last two sentences will prompts the error of "EEException: Invalid argument specified for ee.Number(): <object object at 0x2b9f90c8ed80>":

import eemont

poi = ee.Geometry.Point([image.getNumber("lon"), image.getNumber("lat")]) # A list of two [x,y] coordinates.
print(poi.getInfo())

poi = ee.Geometry.Point(image.getNumber("lon"), image.getNumber("lat")) # varargs.
print(poi.getInfo())

I spent a couple of hours to identify the root of this weird, hard-to-be-spotted issue, so would like to let you and others know about it, although I am not sure if this still exists in the latest version of the eemont. Also not sure if this issue goes to other functions that accept varargs.

All the best,
Fei

@FeiYao-Edinburgh FeiYao-Edinburgh added the bug Something isn't working label Apr 26, 2022
@davemlz
Copy link
Owner

davemlz commented Jul 27, 2022

Hi @FeiYao-Edinburgh!

Ok, this is super weird. I've been trying to look for a solution but I have no idea.

I will keep this issue open. Thank you for spotting it!

Best,

David

@jencaro19
Copy link

@davemlz I have also spent the last hours trying to calculate my indices and no matter what I do they don't seem to be added as new bands. the code runs but when i do zonal statistics they are not there! Is the package offline or maybe i am missing something.
Thank you
image
image

Gracias

@davemlz
Copy link
Owner

davemlz commented Jul 27, 2022

Hi @jencaro19!

S2_HARMONIZED is not yet included in the current version of eemont (0.3.4), but it will be in the following days with the upcoming version (0.3.5). Please see #68. Thank you!

PD: index() and scale() are deprecated since version 0.3.0, please use spectralIndices() and scaleAndOffset(). See https://eemont.readthedocs.io/en/latest/changelog.html#v0-3-0.

Con gusto! :)

@davemlz
Copy link
Owner

davemlz commented Jul 27, 2022

Hi @jencaro19!

eemont v0.3.5 was just released and now you can try it. It should work! :)

pip install -U eemont

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants