-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8662d36
commit 22ab83e
Showing
4 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,4 +209,5 @@ export const SORT_BY = [ | |
'Geohash', | ||
'LatLon', | ||
'PointCount', | ||
'Hilbert', | ||
] as const |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use super::sorting::SortS2; | ||
use crate::s2; | ||
use model::api::single_vec::SingleVec; | ||
|
||
pub fn run(points: SingleVec) -> SingleVec { | ||
let mut l15_map: Vec<(u64, SingleVec)> = s2::create_cell_map(&points, 15).into_iter().collect(); | ||
l15_map.sort_by(|a, b| a.0.cmp(&b.0)); | ||
let mut result = vec![]; | ||
|
||
for (_, mut points) in l15_map { | ||
points.sort_s2_mut(); | ||
result.append(&mut points); | ||
} | ||
result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters