scipy (0.9.0) と matplotlib (1.0.1) の Delaunay 三角形分割ルーチンを比較すると、説明のつかない動作に気付きました。私のポイントは、に保存されている UTM 座標numpy.array([[easting, northing], [easting, northing], [easting, northing]])
です。Scipy のエッジには私のポイントの一部がありませんが、matplotlib のエッジはすべてそこにあります。修正はありますか、それとも何か間違っていますか?
import scipy
import numpy
from scipy.spatial import Delaunay
import matplotlib.delaunay
def delaunay_edges(points):
d = scipy.spatial.Delaunay(points)
s = d.vertices
return numpy.vstack((s[:,:2], s[:,1:], s[:,::-2]))
def delaunay_edges_matplotlib(points):
cens, edges, tri, neig = matplotlib.delaunay.delaunay(points[:,0], points[:,1])
return edges
points = numpy.array([[500000.25, 6220000.25],[500000.5, 6220000.5],[500001.0, 6220001.0],[500002.0, 6220003.0],[500003.0, 6220005.0]])
edges1 = delaunay_edges(points)
edges2 = delaunay_edges_matplotlib(points)
numpy.unique(edges1).shape # Some points missing, presumably nearby ones
numpy.unique(edges2).shape # Includes all points