欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

GEE基础学习——绘制经纬线pixelLonLat

发布时间:2024/3/13 71 豆豆
生活随笔 收集整理的这篇文章主要介绍了 GEE基础学习——绘制经纬线pixelLonLat 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

按分来绘制全球的经纬网

创建一个图像,其中每个像素的值是其 以分钟为单位的坐标。结果图形如下:

代码展示:

// 使用 pixelLonLat() 函数每度绘制 60 条纬度/经度线。 // 创建一个图像,其中每个像素的值是其 // 以分钟为单位的坐标。 var img = ee.Image.pixelLonLat().multiply(60.0);// 获取小数部分并检查它是否小于一个小增量。 img = img.subtract(img.floor()).lt(0.05);// 两个方向上小于 delta 的像素是的网格。 var grid = img.select('latitude').or(img.select('longitude'));// Draw the grid. Map.setCenter(-122.09228, 37.42330, 12); Map.addLayer(grid.updateMask(grid), {palette: '008000'}, 'Graticule');

先展示图形:

If you want to divide the world by degrees, you can use the following code:

//将下面的multiply(60.0)去掉或者改为1.0 var img = ee.Image.pixelLonLat().multiply(1.0);// Get the decimal part and check if it's less than a small delta. img = img.subtract(img.floor()).lt(0.05);// The pixels less than the delta are the grid, in both directions. var grid = img.select('latitude').or(img.select('longitude'));// Draw the grid. Map.setCenter(-122.09228, 37.42330, 12); Map.addLayer(grid.updateMask(grid), {palette: '008000'}, 'Graticule');

总结

以上是生活随笔为你收集整理的GEE基础学习——绘制经纬线pixelLonLat的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。