R语言McSpatial_使用R中的SpatialLine对象提取栅格像素值以及像素xy坐标

本文介绍了如何在R中利用SpatialLines对象从RasterBrick中提取相交像素的值,并获取这些像素的xy坐标。作者尝试了多种方法,包括使用`extract`和`crop`函数,同时探讨了`Rasterize`和`RasterToPoints`的使用场景,以解决从栅格中精确获取线条触碰的像素坐标问题。
摘要由CSDN通过智能技术生成

I have a Spatialline that I converted from a polygon shapefile (digitized manually based on features in "imagebrick" - this means that spatially the "polyline" and "imagebrick" are overlapped as I wanted)

polyline

> polyline

class : SpatialLines

features : 1

extent : 357714.3, 357719, 4076030, 4076035 (xmin, xmax, ymin, ymax)

coord. ref. : +proj=utm +zone=11 +datum=NAD27 +units=m +no_defs +ellps=clrk66 +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat

And a Rasterbrick

> imagebrick

class : RasterBrick

dimensions : 29180, 14940, 435949200, 4 (nrow, ncol, ncell, nlayers)

resolution : 0.6, 0.6 (x, y)

extent : 354038.4, 363002.4, 4066992, 4084500 (xmin, xmax, ymin, ymax)

coord. ref. : +proj

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值