Skip to content
Prev 20070 / 29559 Next

Problems with gDelaunayTriangulation and neighbors.

On Wed, 18 Dec 2013, Christian Jansson wrote:

            
Thanks for a reproducible example.

Well, the Meuse bank data are projected, yours are not. So you also run 
into the GEOS scaling issue. Your input longitude for the third point is:
lon               lat
[1,] -69.9492587302774 -17.9166152585801

while after having been through the GEOS triangulation operator, you get 
for example:
[[1]]
[[1]][[1]]
                           x                      y
[1,] -69.951718409999998016 -17.917070869999999871
[2,] -69.949258729999996831 -17.916615260000000376

where -69.949258729999996831 and -69.9492587302774 do not touch at least 
at the standard scale.

The rgeos function is there simply to expose what GEOS now offers, hence 
the code example on the help page (which you used without referring to it) 
is there to show the hoops you have to jump through to get GEOS to deliver 
triangles or egdes identified by point IDs. As you've seen, deldir does a 
better job at this, but trying alternatives is always sensible.
Project the geographical coordinates?

Hope this clarifies,

Roger