def generateGeohash(self, geoPoint: 'GeoPoint'): latLng = S2LatLng.from_degrees( geoPoint.getLatitude(), geoPoint.getLongitude()) cell = S2Cell.from_lat_lng(latLng) cellId = cell.id() return cellId.id()
def calc_s2id(lat, lng, level): s2id = Cell.from_lat_lng(LatLng(lat, lng)).id().parent(level).id() return f"{s2id:016x}"