1

Once I multiply NDVI and EVI values with 0.0001, I get an error that is shown below. So I can't get the chart.

Error generating chart: Projection error: Unable to compute intersection of geometries in projections and .

var countries=ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017');
var Turkey=countries.filter(ee.Filter.eq('country_na','Turkey'));
var vegIndices = ee.ImageCollection('MODIS/006/MOD13A1')
                     .filterBounds(Turkey)
                     .filter(ee.Filter.date('2012-01-01', '2022-03-30'))
                     .select(['NDVI']);
print('vegIndices',vegIndices)

var ndviScaled = vegIndices.map(function(image) {
  return image.multiply(0.0001)
   .copyProperties(image, ['system:time_start','system:time_end','system:index'])
});

print('scaled_ndvi',ndviScaled)
var chart =
    ui.Chart.image
        .series({
          imageCollection: ndviScaled,
          region: Turkey,
          reducer: ee.Reducer.mean(),
          scale: 500,
          xProperty: 'system:time_start'
});
print(chart);
0

1 Answer 1

1

The issue is in used region. Turkey is a Feature Collection with a Multi Polygon including 25561 vertices in 4 individual Polygons. You need to find out an approach that simplifies that geometry. I'm going to use an easy way to test that it works by using Turkey bounds instead complete geometry. Code looks as follows:

var countries=ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017');
var Turkey = countries.filter(ee.Filter.eq('country_na','Turkey'));
var vegIndices = ee.ImageCollection('MODIS/006/MOD13A1')
                     .filterBounds(Turkey)
                     .filter(ee.Filter.date('2012-01-01', '2022-03-30'))
                     .select(['NDVI']);

Map.centerObject(Turkey);
Map.addLayer(Turkey);
print("Turkey", Turkey);
print("Turkey bounds", Turkey.geometry().bounds());

print('vegIndices',vegIndices);

var ndviScaled = vegIndices.map(function(image) {
  return image.multiply(0.0001)
   .copyProperties(image, ['system:time_start','system:time_end','system:index']);
});

print('scaled_ndvi',ndviScaled);
var chart =
    ui.Chart.image
        .series({
          imageCollection: ndviScaled,
          region: Turkey.geometry().bounds(),
          reducer: ee.Reducer.mean(),
          scale: 500,
          xProperty: 'system:time_start'
});
print(chart);

After running above code in GEE code editor, I got following result with produced chart for Turkey bounds (only 5 vertices):

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.