terra icon indicating copy to clipboard operation
terra copied to clipboard

Click function gives shifted (relatively to the visible plot) coordinates

Open sergeikharchenko opened this issue 1 year ago • 3 comments

Hi!

I have tried to get approximate border of my interest polygons by clicking the border above my raster. Unfortunately, function click always gives me shifted position of points and lines.

Reproducible example:

library(terra)
elev_rast <- rast(system.file("ex/elev.tif", package = "terra"))
plot(elev_rast)
c1 <- click(n = 4, type = "l")

I try to reproduce the line of any valley on the elevation raster. image

But the real positions of objects are always shifted orthogonally (?).

sergeikharchenko avatar Mar 14 '23 07:03 sergeikharchenko

Oh, I'm sorry. I didn't think I should look the unsolved problem description in the list of closed issues. https://github.com/rspatial/terra/issues/1046

sergeikharchenko avatar Mar 14 '23 07:03 sergeikharchenko

I did not close it, but that was a reasonable thing to do since it is a bug in Rstudio: https://github.com/rstudio/rstudio/issues/12682 , not in terra, or in R proper.

rhijmans avatar Mar 15 '23 02:03 rhijmans

There is a workaround suggested here: Set "Display Setting -> Scale -> 100%" That does not help me much as that makes the fonts too small for me to read.

rhijmans avatar Apr 07 '23 16:04 rhijmans