In other words, this function.
Per the comparison to spaghetti and pysal.lib.weights, see if those are helpful. But also see scipy.spatial.KDTree directly.
The main issue is that these will not work out of the box, for point to polygon distances.
The way I would work is:
In other words, this function.
Per the comparison to spaghetti and pysal.lib.weights, see if those are helpful. But also see scipy.spatial.KDTree directly.
The main issue is that these will not work out of the box, for point to polygon distances.
The way I would work is:
df1["_tmp"] = 1and thendf2["_tmp"] = 1), so that is available for both sides of the merge. This will give you and N × M frame.df.distance(df.set_geometry(geo2)and return that.