2017-12-07 11 views
0

특정 지역의 큰 시계열을 내보내려면 어떻게해야합니까? 아이디어는이 지역에 대한 날짜 및 평균 밴드 값이있는 테이블을 얻는 것입니다. 이 경우 지역의 평균 NDVI가됩니다. 단일 지점의 시계열의 경우Google 어스 엔진의 큰 시계열 내보내기

var collectionModNDVI = ee.ImageCollection('MODIS/006/MOD13Q1') 
     .filterDate('2002-01-01', '2017-11-17'); 

var geom = ee.Geometry.Point(-1,40).buffer(250); 

print(ui.Chart.image.series(collectionModNDVI, geom, ee.Reducer.mean(), 30)); 

이 잘 작동 될 것이다 당신은 당신이 CSV에 세리 시간을 다운로드 할 수있는 차트를 얻는다. 그러나 그것이 큰 지역 일 때, 나는 기억과 계산 시간에 관한 이슈를 얻는다.

var table2 = ee.Geometry.Rectangle(-1,40,0,41); 

chart = ui.Chart.image.seriesByRegion(collectionModNDVI,table2, 
     ee.Reducer.mean(), 'NDVI',30, 'system:time_start', 'label'); 

print(chart); 

이 코드를 사용하면 "사용자 메모리 한도 초과"오류가 발생합니다.

나는이 시도 :

Export.table.toDrive({ 
    collection: chart, 
    description:'vectorsToDriveExample', 
    fileFormat: 'csv' 
}); 

을하지만 "d.yc는 함수가 아닙니다"같은 오류가 발생했습니다합니다.

답변

0

표 형식을 지정하는 방법에 대한 자세한 정보를 제공해야합니다. 여기서 얻을 수있는 하나의 밴드를 수출하는 두 가지 방법의 예 시작 :

var roi = /* color: #d63000 */ee.Geometry.Polygon(
     [[[-122.27577209472656, 37.891247253777074], 
      [-122.27577209472656, 37.86875557241152], 
      [-122.24040985107422, 37.86875557241152], 
      [-122.24040985107422, 37.891247253777074]]], null, false); 

// Load imagery. 
var l8 = ee.ImageCollection('LANDSAT/LC8_SR') 
    .filterBounds(roi) 
    .filterDate('2016-01-01', '2016-12-31') 
    .map(function(image) { 
     var qa = image.select('cfmask'); 
     var mask = qa.neq(2).and(qa.neq(4)); 
     return image.updateMask(mask).divide(10000); 
    }); 
print('Size of Landsat collection', l8.size()); // 21 

// Load an Earth Engine table. 
var blocks = ee.FeatureCollection('TIGER/2010/Blocks'); 
var subset = blocks.filterBounds(roi); 
print('Size of Census blocks subset', subset.size()); // 409 

Map.centerObject(roi, 13); 
Map.addLayer(blocks, {color: 'gray'}, 'blocks'); 
Map.addLayer(subset, {}, 'subset'); 

// Collect block, image, value triplets. 
var triplets = l8.map(function(image) { 
    return image.select('B1').reduceRegions({ 
    collection: subset.select(['blockid10']), 
    reducer: ee.Reducer.mean(), 
    scale: 30 
    }).filter(ee.Filter.neq('mean', null)) 
    .map(function(f) { 
     return f.set('imageId', image.id()); 
    }); 
}).flatten(); 
print(triplets.first()); 

// Format a table of triplets into a 2D table of rowId x colId. 
var format = function(table, rowId, colId) { 
    // Get a FeatureCollection with unique row IDs. 
    var rows = table.distinct(rowId); 
    // Join the table to the unique IDs to get a collection in which 
    // each feature stores a list of all features having a common row ID. 
    var joined = ee.Join.saveAll('matches').apply({ 
    primary: rows, 
    secondary: table, 
    condition: ee.Filter.equals({ 
     leftField: rowId, 
     rightField: rowId 
    }) 
    }); 

    return joined.map(function(row) { 
     // Get the list of all features with a unique row ID. 
     var values = ee.List(row.get('matches')) 
     // Map a function over the list of rows to return a list of 
     // column ID and value. 
     .map(function(feature) { 
      feature = ee.Feature(feature); 
      return [feature.get(colId), feature.get('mean')]; 
     }); 
     // Return the row with its ID property and properties for 
     // all matching columns IDs storing the output of the reducer. 
     // The Dictionary constructor is using a list of key, value pairs. 
     return row.select([rowId]).set(ee.Dictionary(values.flatten())); 
    }); 
}; 

var link = '78503bfa1fb76b3a9fa06b515d1e2488'; 

var table1 = format(triplets, 'imageId', 'blockid10'); 

var desc1 = 'table1_demo_' + link; 
Export.table.toDrive({ 
    collection: table1, 
    description: desc1, 
    fileNamePrefix: desc1, 
    fileFormat: 'CSV' 
}); 

var table2 = format(triplets, 'blockid10', 'imageId'); 

var desc2 = 'table2_demo_' + link; 
Export.table.toDrive({ 
    collection: table2, 
    description: desc2, 
    fileNamePrefix: desc2, 
    fileFormat: 'CSV' 
}); 

그 예 this page에서 링크, this presentation에서입니다.

+0

감사합니다. 내가 자신을 올바르게 설명하지 못해 죄송합니다. 내가하려는 일에 대해 더 많은 정보를 추가했습니다. – Xeo

+0

차트를 사용하면 5000 개가 넘는 것들은 작동하지 않습니다. 또한 차트를 내 보낸 것처럼 내보낼 수 없습니다. (내보내려면 [이 참조] (https://developers.google.com/earth-engine/exporting) 참조). 내가 게시 한 예제가 당신을 위해 일한다면 (시도해보십시오!) upvote하십시오. –