Google Earth Engine(GEE)——几何图形ee.Geometry
基础类型方法
类名 | 含义 |
ee.Geometry.LineString | 线段:由一系列点组成的直线 |
ee.Geometry.LineRing | 环:线段首尾相连接 |
ee.Geometry.MultiLineString | 复合线段:多个线段组合在一起 |
ee.Geometry.Point | 点 |
ee.Geometry.MultiPoint | 复合点:多个点组合在一起 |
ee.Geometry.Polygon | 多边形 |
ee.Geometry.Rectangle | 矩形 |
ee.Geometry.MultiPolygon | 复合矩形:多个矩形组合在一起 |
代码
var line = /* color: #d63000 */ee.Geometry.LineString( [[-103.28593749999999, 38.46623315614578], [-94.98027343749999, 40.534424706292405]]), multiLine = /* color: #28db3e */ee.Geometry.MultiLineString( [[[-101.70316271563797, 37.737101081855215], [-96.46658167152503, 38.017322136064934]], [[-105.74687499999999, 35.73286699047012], [-100.34160156249999, 36.584391288158706]]]), point = /* color: #0b4a8b */ee.Geometry.Point([-89.09160156249999, 39.7956206925268]), multiPoint = /* color: #ffc82d */ee.Geometry.MultiPoint( [[-92.65117187499999, 37.42662495543974], [-93.79374999999999, 37.28690130733523]]), polygon = /* color: #00ffff */ee.Geometry.Polygon( [[[-96.86992187499999, 34.438354866968545], [-95.55156249999999, 36.90132207718713], [-97.74882812499999, 35.44697585969926]]]), rectangle = ee.Geometry.Polygon( [[[-93.70585937499999, 36.44311350012563], [-93.70585937499999, 33.63721310743895], [-89.57499999999999, 33.63721310743895], [-89.57499999999999, 36.44311350012563]]], null, false), multiPolygon = /* color: #ff0000 */ee.Geometry.MultiPolygon( [[[[-84.29587208507718, 39.96117602741789], [-84.20893110596711, 38.095486162792234], [-81.32717506033146, 40.59421005772966]]], [[[-83.68632812499999, 34.7277971009936], [-81.97246093749999, 37.8095219161184], [-85.00468749999999, 37.63572230181635]]]]); Map.addLayer(line, {color: "d63000"}, "line");
Map.addLayer(multiLine, {color: "28db3e"}, "multiLine");
Map.addLayer(point, {color: "0b4a8b"}, "point");
Map.addLayer(multiPoint, {color: "ffc82d"}, "multiPoint");
Map.addLayer(polygon, {color: "00ffff"}, "polygon");
Map.addLayer(rectangle, {color: "bf04c2"}, "rectangle");
Map.addLayer(multiPolygon, {color: "ff0000"}, "multiPolygon");
Map.centerObject(point, 4);
空间计算方法
(1)计算Geometry的面积使用area( ),返回值单位为平方米;
(2)提取Geometry的中心点使用centroid( ),返回值是对应Geometry的中心坐标;
(3)提取Geometry对应的外接矩形使用bounds( );
(4)对Geometry做缓冲区域使用buffer( ),如果传入的距离是正整数则对Geometry做向外的扩大缓冲区域,如果传入的距离是负数则可以对Geometry做向内缩小的缓冲区域;
(5)判断两个Geometry是否相交使用intersects( ),返回两个Geometry是否相交的结果,如果两个Geometry相交则返回true,否则返回false;
(6)取得两个Geometry的相交部分内容使用intersection( ),,返回值是两个Geometry相交的新的Geometry;
(7)两个Geometry取得不同的部分使用difference( ),简单来说就是在第一个Geometry但不是不在第二个Geometry的部分。
代码
var polygon1 = /* color: #d63000 */ee.Geometry.Polygon( [[[116.18363255709164, 39.73608336682765], [116.62857884615414, 39.75297820506206], [116.60660618990414, 40.08580181855619], [116.15067357271664, 40.077395868796174]]]);
var polygon2 = /* color: #ffc82d */ee.Geometry.Polygon( [[[116.45728060961198, 40.23636657920226], [116.42981478929948, 39.97166693527704], [116.82806918383073, 39.95903650847623], [116.88849398851823, 40.20700637790917]]]);
Map.centerObject(polygon1, 9);
Map.addLayer(polygon1, {color: "red"}, "polygon1");
Map.addLayer(polygon2, {color: "blue"}, "polygon2");
//polygon area
print("polygon area is: ", polygon1.area());
//polygon bounds
print("polygon bounds is: ", polygon1.bounds());
//polygon center point
print("polygon centroid is: ", polygon1.centroid());
//polygon coordinates
print("polygon coordinates is: ", polygon1.coordinates());
//check intersects
print("polygon1 and polygon2 is intersects ?", polygon1.intersects(polygon2));
var intersec = polygon1.intersection(polygon2);
Map.addLayer(intersec, {}, "intersec");
//outer 2000m
var bufferPolygon1 = polygon1.buffer(2000);
Map.addLayer(bufferPolygon1, {color:"ff00ff"}, "bufferPolygon1");
//innner 2000m
var bufferPolygon2 = polygon1.buffer(-2000);
Map.addLayer(bufferPolygon2, {color:"00ffff"}, "bufferPolygon2");
//difference
var differ = bufferPolygon1.difference(bufferPolygon2);
Map.addLayer(differ, {color:"green"}, "differ");
Google Earth Engine(GEE)——几何图形ee.Geometry相关推荐
- Google Earth Engine(GEE)——User memory limit exceeded(2)
上一次我们已经知道如何去进行避免这种错误的发生,有关详细内容,如果单单只是解决这个问题我们用到的是limit 和 first,上一次的博客在这里: (207条消息) Google Earth Engi ...
- Google Earth Engine(GEE)批量下载代码(以 NDVI数据为例)
下载数据先准备工作(具体细节都能查到):科学上网 谷歌邮箱,谷歌邮箱注册GEE账号. 一:导入需要下载边界shp文件. 标题 找到自己的shp文件,导入除了sbx文件的所有文件. 导入成功 命名ass ...
- 使用Google Earth Engine (GEE)实现MODIS数据批量下载
使用Google Earth Engine GEE实现MODIS数据批量下载 前言 下载数据代码 批量执行run任务 关注公众号,分享GIS知识.ArcGIS教程.SCI论文与科研日常等 前言 上图是 ...
- 基于google earth engine(GEE)下载研究区域影像
基于google earth engine(GEE)下载研究区域影像 当研究需要Landsat数据时,我们可以通过USGS官网或者地理空间数据云平台下载.由于地理空间数据云目前无法下载到较新的数据,可 ...
- Google Earth Engine(GEE) 01-中输入提示快捷键Ctrl+space无法使用的问题
Google Earth Engine(GEE) 01-中输入提示快捷键Ctrl+space无法使用的问题 GEE中 Ctrl+space组合键用于代码输入快捷提示,能够提高编码的准确度和速度,但是, ...
- Google Earth Engine(GEE)——可视化动态图
代码: var geometry = /* color: #d63000 *//* shown: false *//* displayProperties: [{"type": & ...
- Google Earth Engine (GEE) ——卫星影像的监督分类(svm)
问题 GEE 提供哪些机器学习技术? 如何对卫星图像进行监督分类? 如何评估分类器的准确性? 如何手动创建自己的几何图形? 目标 练习查找无云图像和使用手绘几何导入 学习训练和应用分类算法所需的基本功 ...
- 关于google earth engine(GEE)的一些想法与大胆预测
我接触GEE有两年了,GEE留给我的印象是:无所不能. 不管是从庞大的数据量,还是包含遥感的各类算法:随机森林.SVM.CNN,都让人惊讶. 从GEE的云端操作来看,传统遥感需要几个月做出来的全国ND ...
- google earth engine GEE批量 run下载插件
在Google earth engine中,批量导出文件经常遇到多个文件下载的情况,只能一个个点击RUN.这里介绍一款插件,Open Earth Engine extension .该插件的作者是Ma ...
- Google Earth Engine (GEE) ——Earth Engine Explorer (EE Explorer)使用最全解析(8000字长文)
Google 地球引擎简介 Earth Engine Explorer (EE Explorer) 是一个轻量级地理空间图像数据查看器,可以访问Earth Engine Data Catalog 中提 ...
最新文章
- php 计算字符串相邻最大重复数_php如何解决字符串中重复字符的次数并且排序输出的方法...
- Java多线程编程实战指南
- nginx安装编译,动态添加模块及其各模块的作用
- java nlpir_中科院NLPIR中文分词java版
- 算法竞赛入门经典第六章(例题) B - Rails(涉及到栈的运用)
- Visio 2003 Professional 安装序列号
- 强大的代码保护软件 .NET Reactor使用教程(四): .NET Reactor针对De4Dot脱壳工具的应对
- nodejs爬虫与python爬虫_不再羡慕python,nodejs爬虫撸起袖子就是干,爬取宅男女神网大姐姐的高清图片!...
- 网络空间安全——总结
- Vray材质学习笔记04——磨砂金属材质
- 将CAD图纸转换为黑白的PDF文件要怎么操作
- 全球与中国3D打印骨科植入物市场深度研究分析报告
- linux下使用man命令查看系统调用
- android studio 下拉菜单,怎么在android studio中使用Spinner实现一个下拉菜单
- MinGW-w64 安装和使用
- 知道python程序设计基础期末答案_Python程序设计基础_知到答案章节作业期末答案...
- 实习 | 深圳市彼岸心智科技有限公司招募新成员啦
- The Earth Rover
- vue高德地图省市区,区域划分。district.search 一直报no_data
- 03_RabbitMQ快速入门案例
热门文章
- 攻防世界PWN之boi题解
- vue 报错 !!vue-style-loader!css-loader?{“sourceMap“:true}!.
- [转载]计算机视觉牛人(转载)(最早在自动化所论坛上发现的)
- HikariCP连接池设置和监控
- 项目过程发生变更的处理流程
- 人工智能自然语言处理NLP入门教程
- Python-3D图表
- Laravel 常用包汇总
- 自学java工资_你自学java用了多久?薪资如何?
- KEPServerEX 6 之 MQTT Clinet/IOT MQTT 全套配置使用方式(完整版)