GEE入门 | 重采样

  • 函数
  • 例子
    • javascript
    • python

函数

Image.reproject(crs, crsTransform, scale)
输出为image

参数:

Argument Type Details
this: image Image The Image to reproject.
crs Projection The CRS to project the image to.
crsTransform List, default: null The list of CRS transform values. This is a row-major ordering of the 3x2 transform matrix. This option is mutually exclusive with the scale option, and replaces any transform already on the projection.
scale Float, default: null If scale is specified, then the projection is scaled by dividing the specified scale value by the nominal size of a meter in the specified projection. If scale is not specified, then the scale of the given projection will be used.

例子

这里将Sentinel-2影像重采样到100m作为例子。
P.S. 一般引入GEE数据库显示的分辨率一开始都是111319.490……

javascript

function maskS2clouds(image) {var qa = image.select('QA60');// Bits 10 and 11 are clouds and cirrus, respectively.var cloudBitMask = 1 << 10;var cirrusBitMask = 1 << 11;// Both flags should be set to zero, indicating clear conditions.var mask = qa.bitwiseAnd(cloudBitMask).eq(0).and(qa.bitwiseAnd(cirrusBitMask).eq(0));return image.updateMask(mask).divide(10000);
}var geometry = ee.Geometry.Polygon([[[17.86466765871711, 51.805755132803185],[17.86466765871711, 48.51354071088587],[24.85197234621711, 48.51354071088587],[24.85197234621711, 51.805755132803185]]], null, false);var image = ee.ImageCollection('COPERNICUS/S2_SR').filterDate('2017-02-01', '2017-11-30').filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE',30)).map(maskS2clouds).median().clip(geometry);print('Proj and transform info of image:', image.projection().getInfo())
print('Pixel size in meters:', image.projection().nominalScale().getInfo())var reprojected = image.reproject('EPSG:4326',null,100);
print('Proj and transform info after reprojection:', reprojected.projection());
print('Pixel size in meters:', reprojected.projection().nominalScale());

python

def maskS2clouds(image):qa = image.select('QA60');# Bits 10 and 11 are clouds and cirrus, respectively.cloudBitMask = 1 << 10;cirrusBitMask = 1 << 11;# Both flags should be set to zero, indicating clear conditions.mask = qa.bitwiseAnd(cloudBitMask).eq(0).And(qa.bitwiseAnd(cirrusBitMask).eq(0));return image.updateMask(mask).divide(10000);geometry = \ee.Geometry.Polygon([[[17.86466765871711, 51.805755132803185],[17.86466765871711, 48.51354071088587],[24.85197234621711, 48.51354071088587],[24.85197234621711, 51.805755132803185]]], None, False);S2 = ee.ImageCollection('COPERNICUS/S2_SR')\.filterDate('2017-04-01', '2017-09-30')\.map(maskS2clouds)\.median()print('Proj and transform info of image:', image.projection().getInfo())
print('Pixel size in meters:', image.projection().nominalScale().getInfo())var reprojected = image.reproject('EPSG:4326',None,100);
print('Proj and transform info after reprojection:', reprojected.projection());
print('Pixel size in meters:', reprojected.projection().nominalScale());
Proj and transform info of image:{'type': 'Projection', 'crs': 'EPSG:4326', 'transform': [1, 0, 0, 0, 1, 0]}
Pixel size in meters: 111319.49079327357
Proj and transform info after reprojection:{'type': 'Projection', 'crs': 'EPSG:4326', 'transform': [0.0008983152841195215, 0, 0, 0, -0.0008983152841195215, 0]}
Pixel size in meters: 100

GEE入门 | 重采样相关推荐

  1. GEE入门【4】| 矢量数据FeatureCollection(行政区划分)

    GEE入门[4]| 矢量数据FeatureCollection(行政区划分) FeatureCollection数据 筛选 要素信息 其他类型 夜光遥感数据提取 完整代码   这节介绍下Feature ...

  2. GEE(一):GEE入门资料

    什么是Google Earth Engine? 大数据平台 GEE包含的数据集超过 200 个公共的数据集,超过500万张影像,每天的数据量增加大约4000张影像,容量超过 5PB 云计算平台 Goo ...

  3. GEE入门【1】| Python环境配置

    GEE[1]| Python环境配置 GEE简介 python API配置相关 Colab环境配置 GEE开发环境配置 GEE的本地python环境搭建 相关网站 Python API相关资源 第一次 ...

  4. GEE入门之路(从【初学者】角度,大白话)——附海面风速插值代码

    先说明一点,从正式学习GEE(google earth engine)到现在只过去了3个月,我自身就是一个初学者,很多时候从初学者和非常直白的角度去想问题,不会绕弯子,也不懂很复杂的东西.但是也算是入 ...

  5. GEE学习记录~~~

    目录 20220510--学习GEE平台上遥感信息的处理 20220511--GEE中上传tif文件 20221203--GEE计算导出辐射日均值csv 20230114--GEE计算多年辐射平均值导 ...

  6. GEE(Google Earth Engine) 代码学习笔记一 快速入门

    GEE 代码学习笔记一 (GEE 基于JavaScript语言和python语言,我记录的是JavaScript语言) 1.GEE 快速入门 quick start. 2.基本语句 - 简单输出 pr ...

  7. 医学图像处理入门知识 | 格式DICOM,MHD+RAW | 坐标系 | ITK-SNAP | 重采样

    医学图像处理入门知识 引言 常见的医学图像格式 DICOM mhd+raw 坐标系 世界坐标体系 解剖学坐标体系 图像坐标体系 这三个坐标体系有什么关系呢?怎样转换呢? ITK-SNAP工具使用 基本 ...

  8. GEE从入门到放弃(1)

    GEE代码学习 GEE从入门到放弃(1) Reducer 统计 第一步 创建roi兴趣区 var roi = ee.Geometry.Polygon( [[[lng, lat], [lng, lat] ...

  9. 音视频从入门到精通——FFmpeg之swr_convert音频重采样函数分析

    文章目录 音频重采样 swr_alloc函数 swr_alloc_set_opts函数 swr_init函数 swr_convert函数 音频基础 音频开发主要应用有 音频开发具体内容有 音频应用的难 ...

最新文章

  1. Android Lanuch 的资料汇总
  2. Labview-浅谈Labview中VISA的设计
  3. java多线程-生产者消费者模式
  4. 别人的趋势不一定是你的未来
  5. 【EhCache】Java缓存框架使用EhCache结合Spring AOP
  6. VueTreeselect出现unknown解决方法
  7. 极域电子教室超级管理员密码
  8. 计算机视觉论文-2021-08-03
  9. android中svn合并分支,Android Studio之SVN打分支、切换分支及合并分支
  10. 判断邮箱格式是否正确(C#实现正则表达式实现)
  11. openwrt路由器(红米AC2100)折腾全程——多拨、ipv6负载均衡、ipv6 nat6、ddns、端口转发
  12. 场景管理:四叉树算法C++实现
  13. luogu4188 [USACO18JAN]Lifeguards S
  14. Redis说无法分配内存该怎么办?
  15. 当年,我被智联招聘坑惨了!
  16. 忆阻器的概念和实现原理
  17. Fliqlo时钟Windows、IOS屏保
  18. 8910DM:FOTA 升级指导
  19. 写个python,爬行【游明星空】的壁纸(4)
  20. Python入门(二十六)测试(一)

热门文章

  1. oracle 权限 策略,Oracle学习笔记(14)权限管理(
  2. Win11 忘记密码
  3. 指针赋值(深拷贝 浅拷贝)
  4. 【mysql 数据库监控篇】数据库表空间大小监控
  5. DDR看这篇就够了(持续更新)
  6. QTP简单框架(8)之HTML报表
  7. 挨踢人生路--记我的10年18家工作经历 续 .转
  8. java contains方法_Java contains用法示例
  9. R语言中的cor和cov和pcor
  10. 杂志征稿 教育杂志征稿