@@ -1122,6 +1122,9 @@ def match_coordinates(
11221122 distance : str, optional
11231123 Distance to use for non-exact matching. Possible values are "euclidean", "haversine" and
11241124 "approx". Default: "euclidean"
1125+ unit : str, optional
1126+ Unit to use for non-exact matching. Possible values are "degree", "m", "km".
1127+ Default: "degree"
11251128 threshold : float, optional
11261129 If the distance to the nearest neighbor exceeds `threshold`, the index `-1` is assigned.
11271130 Set `threshold` to 0 to disable nearest neighbor matching. Default: 100 (km)
@@ -1255,6 +1258,9 @@ def match_centroids(
12551258 Distance to use in case of vector centroids.
12561259 Possible values are "euclidean", "haversine" and "approx".
12571260 Default: "euclidean"
1261+ unit : str, optional
1262+ Unit to use for non-exact matching. Possible values are "degree", "m", "km".
1263+ Default: None
12581264 threshold : float, optional
12591265 If the distance (in km) to the nearest neighbor exceeds `threshold`,
12601266 the index `-1` is assigned.
@@ -1331,6 +1337,8 @@ def _nearest_neighbor_approx(
13311337 coordinates : 2d array
13321338 First column contains latitude, second
13331339 column contains longitude. Each row is a geographic point
1340+ unit : str
1341+ Unit to use for non-exact matching. Only possible value is "degree"
13341342 threshold : float
13351343 distance threshold in km over which no neighbor will
13361344 be found. Those are assigned with a -1 index
@@ -1405,6 +1413,8 @@ def _nearest_neighbor_haversine(centroids, coordinates, unit, threshold):
14051413 coordinates : 2d array
14061414 First column contains latitude, second
14071415 column contains longitude. Each row is a geographic point
1416+ unit : str
1417+ Unit to use for non-exact matching. Only possible value is "degree"
14081418 threshold : float
14091419 distance threshold in km over which no neighbor will
14101420 be found. Those are assigned with a -1 index
@@ -1467,13 +1477,16 @@ def _nearest_neighbor_euclidean(
14671477 coordinates : 2d array
14681478 First column contains latitude, second column contains longitude. Each
14691479 row is a geographic point
1480+ unit : str
1481+ Unit to use for non-exact matching. Possible values are "degree", "m", "km".
14701482 threshold : float
14711483 distance threshold in km over which no neighbor will be found. Those
14721484 are assigned with a -1 index
14731485 check_antimedirian: bool, optional
14741486 If True, the nearest neighbor in a strip with lon size equal to threshold around the
14751487 antimeridian is recomputed using the Haversine distance. The antimeridian is guessed from
14761488 both coordinates and centroids, and is assumed equal to 0.5*(lon_max+lon_min) + 180.
1489+ Requires the coordinates to be in degrees.
14771490 Default: True
14781491
14791492 Returns
0 commit comments