// Read about this at github.com/kunukn/single-detect static void SetKnnAlgo(IPoints points) { IPointsKnn dataset = new PointsKnn(); dataset.Data.AddRange(points.Data.Select(i => i as IPKnn)); var rect = new SingleDetectLibrary.Code.Data.Rectangle { XMin = -190, XMax = 190, YMin = -100, YMax = 100, MaxDistance = 20, }; rect.Validate(); // Naive stratey works with all points on Earth. // Grid strategy runs much faster and can be used as approx algo // but only works on certain local areas, not wrapped world. e.g. from lon -90 to lon 90, // e.g. Europe only areas or US only areas etc. but not New Zealand due to being near lon 180. // All points must be within rect boundary IKnnAlgorithm algo = new KnnAlgorithm(dataset, rect, StrategyType.Naive); Data = algo; }
// Read about this at github.com/kunukn/single-detect static void SetKnnAlgo(IPoints points) { IPointsKnn dataset = new PointsKnn(); dataset.Data.AddRange(points.Data.Select(i => i as IPKnn)); var rect = new SingleDetectLibrary.Code.Data.Rectangle { XMin = -190, XMax = 190, YMin = -100, YMax = 100, MaxDistance = 20, }; rect.Validate(); // Naive stratey works with all points on Earth. // Grid strategy runs much faster and can be used as approx algo // but only works on certain local areas, not wrapped world. e.g. from lon -90 to lon 90, // e.g. Europe only areas or US only areas etc. but not New Zealand due to being near lon 180. // All points must be within rect boundary IKnnAlgorithm algo = new KnnAlgorithm(dataset, rect, StrategyType.Naive); Data = algo; }