Incorrect values returned by sp::over function?

空扰寡人 提交于 2019-12-12 04:53:53

问题


I'm extracting elevation data of a route from a Digital Elevation Model using

my.elev <- over(new.points, mygrid)
  • new.points is a SpatialPoints object, with the coordinates (long/lat) of about 7000 points transformed in the CRS of mygrid
  • mygrid is a SpatialGridDataFrame with more than 8 millions elements
    (more info in my previous question)

Having several NA values in my.elev, I debugged my code and I found that almost all the points in new.points repeated more than one time (in my route few segments are crossed two times):
- the first occurrence has the corresponding my.elev value correct
- the second one has a NA value (or sometimes, a quite different value)

I can easily solve the problem eliminating the duplicated values in new.points, but I wonder why the over function doesn't return the same value for the same point.

来源:https://stackoverflow.com/questions/27060307/incorrect-values-returned-by-spover-function

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!