-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
index() does not work when called within .map() #2
Comments
Hi Andres! Thank you very much for pointing this out, I will check it. Is there any chance I can get access to the feature collection to try it? In the meantime, let me tell you that you can get the time series from a feature collection by using the oliCol = (ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(featurecollection)
.filterDate('2013-01-01','2015-01-01')
.scale()
.index('NDVI'))
ts = oliCol.getTimeSeriesByRegions(collection = featurecollection,
reducer = ee.Reducer.mean(),
bands = 'NDVI',
scale = 1000,
tileScale = 4) Let me know if it works! And I will check the error to see what's happening. Cheers! |
Thanks, I'll look into getTimeSeriesByRegions. I am doing a bit of harmonization prior (merging different Landsat collections) and running this for multiple countries, which is why I was implementing a custom function - if I don't use filterBounds for each country it will probably time out. Sure, send me your gmail and I'll share the feature collection. |
Hi Andres! Ok, now I understand. You can share your feature collection to this gmail. Thanks! |
Hi Andres! I have checked your script, and now I know what's happening: The problem is associated to the _get_platform function. This function uses the Since In this case, the problem can be solved by working in the client-side and not in the server-side. This works perfectly: countries = ['Ethiopia','Ghana','Nicaragua'] # client-side object, don't use here an ee.List since it is a server-side object
features = []
for country in countries: # client-side loop
# Here, the name of each country (a client-side object)
# is used to filter the feature collection and a
# server-side object is retrieved (an ee.Feature)
# and it is appended to the list
features.append(getStats(AOIs.filterMetadata('WB_ADM0_NA', 'equals',country)))
# Here, the list of ee.Feature objects is converted into an ee.FeatureCollection
ee.FeatureCollection(features) I'll close this issue for now and I'll open a new issue regarding the use of the Thank you very much for your time and attention here! Cheers! |
Hey!
First of all great work, very useful package. I am trying to create a time series dataset of indices based on Landsat collections. I have prepared a basic function that works well when it's run with one feature, but it fails when mapped to a feature collection. Here is a simplified version of the function:
This works:
But this fails:
with the following error
Something is happening that prevents _get_platform from running properly. Is this expected? Any ideas how to fix?
The text was updated successfully, but these errors were encountered: