【发布时间】:2018-04-18 05:45:16
【问题描述】:
在这里,我有不同的表 firestore,但计算两个表的距离,即来自 firestore 的 Driver_details 和 Current_booking。在 firestore driver_details 表中,Driver_details -> City(如 bangalore、chennai 等)-> SubLocality(如 st.thomas、rajivi street 等)-> Driver 文档 id -> 参数值(包含:lat、long、name、 id 等)和 Current_booking 表看起来像 Current_booking -> 文档 id -> 参数值(Start_lat、Start_long 等)。
如何计算距离 driver_detaisl -> city -> sublocality 和 Current_booking 的 lat long,然后过滤距离最近的用户 lat long 的位置驱动程序 这是我的firestore db的截图:
【问题讨论】:
-
如果你有两个 cllocation 点,那么你应该计算它们的距离。
-
是的,那么如何筛选离用户最近的驱动程序?\
标签: ios swift xcode firebase google-cloud-firestore