Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. var collectionFilter = ee.ImageCollection('LANDSAT/LC08/C01/T1_RT_TOA')
  2. .filterBounds(geometry)
  3. .filterMetadata('CLOUD_COVER','less_than',4)
  4. .map(app);
  5. print(collectionFilter)
  6.  
  7. var app = function (image)
  8. {
  9. //indice de vegetação
  10. var ndvi = image.normalizedDifference(['B5', 'B4']);
  11. image=image.addBands (ndvi.rename('NDVI'));
  12.  
  13. return image
  14. }
  15.  
  16. Map.onClick(function(lonlat){
  17. var pixel = ee.Geometry.Point([lonlat.lon, lonlat.lat])
  18. var collection = collectionFilter
  19. .select(
  20. ["NDVI"]
  21. )
  22. var options = {
  23. title : 'NDVI CHART VALUES'
  24. };
  25.  
  26. var graph = (
  27. ui.Chart.image.series(
  28. collection,
  29. pixel,
  30. ee.Reducer.mean(),
  31. 30
  32. )
  33. .setOptions(options)
  34. );
  35. print(graph
  36.  
  37. )
  38.  
  39. Export.table.toDrive({
  40. collection: collection,
  41. description: 'exporting in json format each click',
  42. fileFormat: 'JSON'
  43. });
  44.  
  45. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement