我正在使用 RGDAL 读取并绘制 geotiff 文件:
df.gtiff = readOGR("/df.tif")
image(df.gtiff, red=1, green=2, blue=3)
该地图包含一些完全平坦的表面,这些表面要么是湖泊,要么是海洋部分,即存在连续像素具有相同高度的斑块。有什么方法可以识别这些补丁,比如多边形,以便我可以统一着色它们(例如蓝色)?[注:文件太大,无法上传,gdalinfo(df.tif)
如下所示):
Driver: GTiff/GeoTIFF
Files: ~/df.tif
Size is 2928, 2285
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (81.381111111111110,22.564444444444447)
Pixel Size = (0.002083333333333,-0.002083333333333)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 81.3811111, 22.5644444) ( 81d22'52.00"E, 22d33'52.00"N)
Lower Left ( 81.3811111, 17.8040278) ( 81d22'52.00"E, 17d48'14.50"N)
Upper Right ( 87.4811111, 22.5644444) ( 87d28'52.00"E, 22d33'52.00"N)
Lower Right ( 87.4811111, 17.8040278) ( 87d28'52.00"E, 17d48'14.50"N)
Center ( 84.4311111, 20.1842361) ( 84d25'52.00"E, 20d11' 3.25"N)
Band 1 Block=2928x1 Type=Byte, ColorInterp=Red
Band 2 Block=2928x1 Type=Byte, ColorInterp=Green
Band 3 Block=2928x1 Type=Byte, ColorInterp=Blue