common_function/scalars/
geo.rs1use std::sync::Arc;
16pub(crate) mod encoding;
17mod geohash;
18mod h3;
19mod helpers;
20mod measure;
21mod relation;
22mod s2;
23mod wkt;
24
25use crate::function_registry::FunctionRegistry;
26
27pub(crate) struct GeoFunctions;
28
29impl GeoFunctions {
30 pub fn register(registry: &FunctionRegistry) {
31 registry.register(Arc::new(geohash::GeohashFunction));
33 registry.register(Arc::new(geohash::GeohashNeighboursFunction));
34
35 registry.register(Arc::new(h3::H3LatLngToCell));
37 registry.register(Arc::new(h3::H3LatLngToCellString));
38
39 registry.register(Arc::new(h3::H3CellBase));
41 registry.register(Arc::new(h3::H3CellIsPentagon));
42 registry.register(Arc::new(h3::H3StringToCell));
43 registry.register(Arc::new(h3::H3CellToString));
44 registry.register(Arc::new(h3::H3CellCenterLatLng));
45 registry.register(Arc::new(h3::H3CellResolution));
46
47 registry.register(Arc::new(h3::H3CellCenterChild));
49 registry.register(Arc::new(h3::H3CellParent));
50 registry.register(Arc::new(h3::H3CellToChildren));
51 registry.register(Arc::new(h3::H3CellToChildrenSize));
52 registry.register(Arc::new(h3::H3CellToChildPos));
53 registry.register(Arc::new(h3::H3ChildPosToCell));
54 registry.register(Arc::new(h3::H3CellContains));
55
56 registry.register(Arc::new(h3::H3GridDisk));
58 registry.register(Arc::new(h3::H3GridDiskDistances));
59 registry.register(Arc::new(h3::H3GridDistance));
60 registry.register(Arc::new(h3::H3GridPathCells));
61
62 registry.register(Arc::new(h3::H3CellDistanceSphereKm));
64 registry.register(Arc::new(h3::H3CellDistanceEuclideanDegree));
65
66 registry.register(Arc::new(s2::S2LatLngToCell));
68 registry.register(Arc::new(s2::S2CellLevel));
69 registry.register(Arc::new(s2::S2CellToToken));
70 registry.register(Arc::new(s2::S2CellParent));
71
72 registry.register(Arc::new(wkt::LatLngToPointWkt));
74
75 registry.register(Arc::new(relation::STContains));
77 registry.register(Arc::new(relation::STWithin));
78 registry.register(Arc::new(relation::STIntersects));
79
80 registry.register(Arc::new(measure::STDistance));
82 registry.register(Arc::new(measure::STDistanceSphere));
83 registry.register(Arc::new(measure::STArea));
84 }
85}