Giter VIP home page Giter VIP logo

Comments (4)

davemlz avatar davemlz commented on August 25, 2024 1

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 getInfo() client method in order to get the ID of the ee.Image (or ee.ImageCollection) so different eemont methods such as scale(), maskClouds() or index() can be computed according to the parameters of the specific satellite platform.

Since getInfo() is a client method and not a server method, it can't be mapped (it can't be used within a map() function). Check the Debugging Guide.

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 getInfo() method inside the _get_platform function. I hope to find a way to use just server-side methods inside eemont soon.

Thank you very much for your time and attention here!

Cheers!

from eemont.

davemlz avatar davemlz commented on August 25, 2024

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 getTimeSeriesByRegions() method from eemont 0.1.9 (example here):

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!

from eemont.

andresfchamorro avatar andresfchamorro commented on August 25, 2024

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.

from eemont.

davemlz avatar davemlz commented on August 25, 2024

Hi Andres!

Ok, now I understand.

You can share your feature collection to this gmail.

Thanks!

from eemont.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.