diff --git a/nes/__init__.py b/nes/__init__.py index 0234c9469176e1099ea6a98e3d319a5b1d9f0c04..818c5fe7adf52a5f4c6d4a3e9735b9378756e6d5 100644 --- a/nes/__init__.py +++ b/nes/__init__.py @@ -1,4 +1,4 @@ -__date__ = "2025-07-03" +__date__ = "2025-07-10" __version__ = "1.1.11" __all__ = [ 'open_netcdf', 'concatenate_netcdfs', 'create_nes', 'from_shapefile', 'calculate_geometry_area', 'Nes', 'LatLonNes', diff --git a/nes/methods/spatial_join.py b/nes/methods/spatial_join.py index bfe9cc16ad09b09091c1958c0d99ac9fc25569b8..6e16cb674e26759b2d70269283349e6cff58ca69 100644 --- a/nes/methods/spatial_join.py +++ b/nes/methods/spatial_join.py @@ -41,8 +41,12 @@ def spatial_join(self, ext_shp, method=None, var_list=None, info=False, apply_bb sys.stdout.flush() self.create_shapefile() - ext_shp = __prepare_external_shapefile(self, ext_shp=ext_shp, var_list=var_list, info=info, - apply_bbox=apply_bbox) + if method == "nearest": + ext_shp = __prepare_external_shapefile(self, ext_shp=ext_shp, var_list=var_list, info=info, + apply_bbox=False) + else: + ext_shp = __prepare_external_shapefile(self, ext_shp=ext_shp, var_list=var_list, info=info, + apply_bbox=apply_bbox) if method == "nearest": # Nearest centroids to the shapefile polygons