# pysal.lib.weights.min_threshold_dist_from_shapefile¶

pysal.lib.weights.min_threshold_dist_from_shapefile(shapefile, radius=None, p=2)[source]

Parameters: shapefile : string shapefile name with shp suffix. radius : float If supplied arc_distances will be calculated based on the given radius. p will be ignored. p : float Minkowski p-norm distance metric parameter: 1<=p<=infinity 2: Euclidean distance 1: Manhattan distance d : float Maximum nearest neighbor distance between the n observations.

Notes

Supports polygon or point shapefiles. For polygon shapefiles, distance is based on polygon centroids. Distances are defined using coordinates in shapefile which are assumed to be projected and not geographical coordinates.

Examples

>>> import pysal.lib
>>> md = pysal.lib.weights.user.min_threshold_dist_from_shapefile(pysal.lib.examples.get_path("columbus.shp"))
>>> md
0.6188641580768541