libpysal.weights.
min_threshold_dist_from_shapefile
(shapefile, radius=None, p=2)[source]¶Kernel weights with adaptive bandwidths.
Parameters: |
|
---|---|
Returns: |
|
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 libpysal
>>> md = libpysal.weights.user.min_threshold_dist_from_shapefile(libpysal.examples.get_path("columbus.shp"))
>>> md
0.6188641580768541
>>> libpysal.weights.user.min_threshold_dist_from_shapefile(libpysal.examples.get_path("stl_hom.shp"), libpysal.cg.sphere.RADIUS_EARTH_MILES)
31.846942936393717