Google Earth Engine:找到正确的图像尺寸以获得卫星图像的最大分辨率
Google Earth Engine: Finding the right image dimensions to get max resolution on satellite imagery
我是 Google Earth Engine 的新手,正在尝试获取整个刚果民主共和国的陆地卫星图像。该项目涉及一些计算机视觉和图像分割,因此我需要获得尽可能高的分辨率。
我有一些代码是我从地球引擎开发的,用于根据下面发布的 1 年陆地卫星图像制作合成图。
var geometry = ee.Geometry.Polygon(
[[[29.70703125, -3.3160183381615123],
[24.609375, -3.4476246666468526],
[24.8291015625, -7.732765062729807],
[29.970703125, -7.645664723491028]]]);
// Composite 6 months of Landsat 8.
Map.setCenter( 26.362312, -4.643601, 5);
var boundingBox = geometry.bounds(1)
var L8 = ee.ImageCollection('LANDSAT/LC08/C01/T1');
var composite = ee.Algorithms.Landsat.simpleComposite({
collection: L8.filterDate('2015-1-1', '2015-7-1').filterBounds(geometry),
asFloat: true});
var region = ee.Geometry(geometry.getInfo())
.toGeoJSONString()
var params ={
crs: 'EPSG:4326',
region:region
}
Export.image(composite,'congo_test',params);
问题是每次我 运行 脚本都会询问我 scale
值。所以我要求最高分辨率,但查询一直出错,因为它说我已经超过了图像导出的最大像素限制。
所以基本上我需要弄清楚如何将刚果分割成一组块,Earth Engine 允许我为这些块提取最大分辨率的合成图像。有谁知道我如何才能计算出符合要求的正确大小的多边形?
如@Val 所示,这里的解决方案是将 maxPixels
参数应用于 javascript 中的 param
变量。下面最后的 javascript 代码将根据 maxPixels 参数自动将图像分解成块。
var geometry = ee.Geometry.Polygon(
[[[29.70703125, -3.3160183381615123],
[24.609375, -3.4476246666468526],
[24.8291015625, -7.732765062729807],
[29.970703125, -7.645664723491028]]]);
// Composite 6 months of Landsat 8.
Map.setCenter( 26.362312, -4.643601, 5);
var boundingBox = geometry.bounds(1)
var L8 = ee.ImageCollection('LANDSAT/LC08/C01/T1');
var composite = ee.Algorithms.Landsat.simpleComposite({
collection: L8.filterDate('2015-1-1', '2015-7-1').filterBounds(geometry),
asFloat: true});
var region = ee.Geometry(geometry.getInfo())
.toGeoJSONString()
var params ={
crs: 'EPSG:4326',
maxPixels: 1e12,
region:region
}
Export.image(composite,'congo_test',params);
这对我有用。谢谢@Val.
您应该在导出参数中指定比例。复合材料不再具有原始比例,因此它们默认为每像素 1 度。由于您开始使用 landsat,您可能需要 30 的比例。
我是 Google Earth Engine 的新手,正在尝试获取整个刚果民主共和国的陆地卫星图像。该项目涉及一些计算机视觉和图像分割,因此我需要获得尽可能高的分辨率。
我有一些代码是我从地球引擎开发的,用于根据下面发布的 1 年陆地卫星图像制作合成图。
var geometry = ee.Geometry.Polygon(
[[[29.70703125, -3.3160183381615123],
[24.609375, -3.4476246666468526],
[24.8291015625, -7.732765062729807],
[29.970703125, -7.645664723491028]]]);
// Composite 6 months of Landsat 8.
Map.setCenter( 26.362312, -4.643601, 5);
var boundingBox = geometry.bounds(1)
var L8 = ee.ImageCollection('LANDSAT/LC08/C01/T1');
var composite = ee.Algorithms.Landsat.simpleComposite({
collection: L8.filterDate('2015-1-1', '2015-7-1').filterBounds(geometry),
asFloat: true});
var region = ee.Geometry(geometry.getInfo())
.toGeoJSONString()
var params ={
crs: 'EPSG:4326',
region:region
}
Export.image(composite,'congo_test',params);
问题是每次我 运行 脚本都会询问我 scale
值。所以我要求最高分辨率,但查询一直出错,因为它说我已经超过了图像导出的最大像素限制。
所以基本上我需要弄清楚如何将刚果分割成一组块,Earth Engine 允许我为这些块提取最大分辨率的合成图像。有谁知道我如何才能计算出符合要求的正确大小的多边形?
如@Val 所示,这里的解决方案是将 maxPixels
参数应用于 javascript 中的 param
变量。下面最后的 javascript 代码将根据 maxPixels 参数自动将图像分解成块。
var geometry = ee.Geometry.Polygon(
[[[29.70703125, -3.3160183381615123],
[24.609375, -3.4476246666468526],
[24.8291015625, -7.732765062729807],
[29.970703125, -7.645664723491028]]]);
// Composite 6 months of Landsat 8.
Map.setCenter( 26.362312, -4.643601, 5);
var boundingBox = geometry.bounds(1)
var L8 = ee.ImageCollection('LANDSAT/LC08/C01/T1');
var composite = ee.Algorithms.Landsat.simpleComposite({
collection: L8.filterDate('2015-1-1', '2015-7-1').filterBounds(geometry),
asFloat: true});
var region = ee.Geometry(geometry.getInfo())
.toGeoJSONString()
var params ={
crs: 'EPSG:4326',
maxPixels: 1e12,
region:region
}
Export.image(composite,'congo_test',params);
这对我有用。谢谢@Val.
您应该在导出参数中指定比例。复合材料不再具有原始比例,因此它们默认为每像素 1 度。由于您开始使用 landsat,您可能需要 30 的比例。