R: over-write xy coordinates of raster layer
问题 I have a raster with XY pixel coordinates which I want to convert to lat and long. class : RasterLayer dimensions : 1617, 1596, 2580732 (nrow, ncol, ncell) resolution : 1, 1 (x, y) extent : 0, 1596, 0, 1617 (xmin, xmax, ymin, ymax) coord. ref. : NA data source : C:\janW1.png names : janW1 values : 0, 255 (min, max) I have calculated the lat/long coords using the formula specified here. This has resulted in the following dataframe heads(cords) lat lon x y janW1 1 46.99401 -14.99122 0.5 1616.5