我正在研究Google Earth Engine中的地表水数据。 我想从此处导出tiff文件,并在Mapbox中使用它们。
我正在尝试从Google Earth引擎导出tiff图像,但是我的图像在几何上出现错误。
我尽了一切努力,但我不知道自己在哪里做错了。
// Asset List
var gsw = ee.Image('JRC/GSW1_0/GlobalSurfaceWater');
var occurrence = gsw.select('occurrence');
var change = gsw.select("change_abs");
var roi = /* color: 0B4A8B */ee.Geometry.Polygon(
[[[-74.17213, -8.65569],
[-74.17419, -8.39222],
[-74.38362, -8.36980],
[-74.43031, -8.61293]]]);
// Constants
var VIS_OCCURRENCE = {
min:0,
max:100,
palette: ['red', 'blue']
};
var VIS_CHANGE = {
min:-50,
max:50,
palette: ['red', 'grey', 'limegreen']
};
var VIS_WATER_MASK = {
palette: ['white', 'black']
};
//////////////////////////////////////////////////////////////
// Calculations
//////////////////////////////////////////////////////////////
// Create a water mask layer, and set the image mask so that non-water areas are transparent.
var water_mask = occurrence.gt(90).mask(1);
// Generate a histogram object and print it to the console tab.
var histogram = ui.Chart.image.histogram({
image: change,
region: roi,
scale: 30,
minBucketWidth: 10
});
histogram.setOptions({
title: 'Histogram of surface water change intensity.'
});
print(histogram);
//////////////////////////////////////////////////////////////
// Initialize Map Location
//////////////////////////////////////////////////////////////
// Uncomment one of the following statements to center the map on
// a particular location.
// Map.setCenter(-90.162, 29.8597, 10); // New Orleans, USA
// Map.setCenter(-114.9774, 31.9254, 10); // Mouth of the Colorado River, Mexico
// Map.setCenter(-111.1871, 37.0963, 11); // Lake Powell, USA
// Map.setCenter(149.412, -35.0789, 11); // Lake George, Australia
// Map.setCenter(105.26, 11.2134, 9); // Mekong River Basin, SouthEast Asia
// Map.setCenter(90.6743, 22.7382, 10); // Meghna River, Bangladesh
// Map.setCenter(81.2714, 16.5079, 11); // Godavari River Basin Irrigation Project, India
// Map.setCenter(14.7035, 52.0985, 12); // River Oder, Germany & Poland
// Map.setCenter(-59.1696, -33.8111, 9); // Buenos Aires, Argentina\
Map.setCenter(77.1025, 28.7041, 5); // India
//////////////////////////////////////////////////////////////
// Map Layers
//////////////////////////////////////////////////////////////
Map.addLayer({
eeObject: water_mask,
visParams: VIS_WATER_MASK,
name: '90% occurrence water mask',
shown: false
});
Map.addLayer({
eeObject: occurrence.updateMask(occurrence.divide(100)),
name: "Water Occurrence (1984-2015)",
visParams: VIS_OCCURRENCE,
shown: false
});
Map.addLayer({
eeObject: change,
visParams: VIS_CHANGE,
name: 'occurrence change intensity'
});
Export.image.toDrive({
image: gsw.toInt32(),
description: 'gsw',
region: gsw,
scale:250
});
The expected output is multiple Tiff files that show complete data.
答案 0 :(得分:0)
也许您忘记添加要导出的图像类型
//Export
Export.image.toDrive({
image: image that you wanna export,
description: 'file name',
scale: 250,
folder: 'your folder name',
region: you region,
fileFormat: 'GeoTIFF'
})