davemlz / eemont

A python package that extends Google Earth Engine.
https://eemont.readthedocs.io/
MIT License
407 stars 69 forks source link

ERROR IN TIME SERIES EXTRACTION BY POINTS IN SHAPEFILE #41

Closed mariofomacajr closed 3 years ago

mariofomacajr commented 3 years ago

I can't extract time series using a shapefile with multiple points as input. There is a error when I run tsPandas = geemap.ee_to_pandas(ts). eemont time series by points.zip

davemlz commented 3 years ago

I have checked it and it is a bug.

For now, I'll let you here a workaround:

points_shp = 'samples_mococa.shp'

points = geemap.shp_to_ee(points_shp)

L8 = (ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
      .filterBounds(points)
      .filterDate('2017-08-01','2020-10-31')
      .maskClouds()
      .scale()
      .index(['EVI','NDVI']))

ts = L8.getTimeSeriesByRegions(reducer = [ee.Reducer.first()],
                               collection = points,
                               bands = ['EVI','NDVI'],
                               scale = 30)

tsPandas = geemap.ee_to_pandas(ts)

Use this code and ignore the NDVI values since you need just the EVI values. It seems that the code is not working correctly when just one band is required by the method. I'll work on it, thank you for pointing this out!

davemlz commented 3 years ago

The error was fixed! If you download de dev version, it should work :rocket: