NGeoKDBush 1.0.1

dotnet add package NGeoKDBush --version 1.0.1                
NuGet\Install-Package NGeoKDBush -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NGeoKDBush" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NGeoKDBush --version 1.0.1                
#r "nuget: NGeoKDBush, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NGeoKDBush as a Cake Addin
#addin nuget:?package=NGeoKDBush&version=1.0.1

// Install NGeoKDBush as a Cake Tool
#tool nuget:?package=NGeoKDBush&version=1.0.1                

NGeoKDBush

This library allows indexing geographical points, and then querying for all points of interest that are some distance from some location. The points will be returned ordered by being closet to furthest.

It implements fast nearest neighbors queries for locations on Earth, taking Earth curvature and date line wrapping into account. Direct port of geokdbush which itself was inspired by sphere-knn, but uses a different algorithm.

A geographic extension for nkdbush.

Example


var index = new KDBush<City>(cities.ToArray(), p => p.Lon, p => p.Lat);
var geoKdBush = new GeoKDBush<City>();
var nearest = geoKdBush.Around(index, -119.7051, 34.4363, 5);

API

Around(IKDBush<T> index, double lng, double lat, int? maxResults = null, double? maxDistance = null, Predicate<T> predicate = null)

Returns an array of the closest points from a given location in order of increasing distance.

  • index: nkdbush index.
  • lng: query point longitude.
  • lat: query point latitude.
  • maxResults: (optional) maximum number of points to return (int.MaxValue by default).
  • maxDistance: (optional) maximum distance in kilometers to search within (double.MaxValue by default).
  • predicate: (optional) a lambda to filter the results with.
Distance(double lng, double lat, double lng2, double lat2)

Returns great circle distance between two locations in kilometers.

Performance

I have found the performance of this port fast enough for my purposes, so I haven't yet had the justification to run micro-bechmarks.
However, I'm sure many performance improvements are possilbe and I might get to it someday.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NGeoKDBush:

Package Downloads
DevCrew.SuperCluster

a C# library that provides an efficient way to cluster large point datasets. This library is based on the popular Supercluster JavaScript library by Mapbox and has been optimized for performance in .NET environments.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 12,726 4/9/2019
1.0.0 1,050 5/26/2018