1

I have something resembling transect data, with a SpatialLines object with a non-linear path,

x <- seq(1,10, 0.1); y <- sin(x) * exp(-0.2 * x); 
path <- data.frame(x,y)
coordinates(path) <- ~x+y
path <- as(path, "SpatialLines")

a SpatialPoints object that stores coordinates along the path at which the observation was recorded, and the perpendicular offset from the path to the observation.

path_sample_points <- spsample(path, 50, "regular"); offset = rnorm(50, 0, 1)

Using R, I need to get the real coordinates at which each observation was made.

Since the path isn't linear, using the DSpat package is out, which would otherwise have been perfect.

Any help with R or QGIS is most welcome!

  • 1
    Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). This will make it much easier for others to help you. – Axeman Jan 12 '17 at 15:33
  • Don't know if if I understand properly the question, but it feels to me that you should also know the "direction" of the offset, and not only its magnitude, to be able to compute the coordinates of the observations, isn't it ? – lbusett Jan 12 '17 at 19:29
  • Yeah, sorry, the offset must be perpendicular to the line at the point. Edited the q. to make it clear. – pratikunterwegs Jan 12 '17 at 19:35
  • You may want to add more details, figures or example to your question. It is hard to figure out what you want exactly. – Bastien Feb 06 '17 at 19:59

0 Answers0