【问题标题】:Mark geo location on android app whose locations are exist within 5Km radius values around me.在我周围 5 公里半径值范围内的 android 应用上标记地理位置。
【发布时间】:2019-05-04 17:12:48
【问题描述】:

我在 orcle 数据库表中有纬度和经度值列表。 在 Android 应用程序中,我想标记那些在我当前地理位置周围半径值低于 5 公里的位置。我该怎么做? 谁能解决这个问题,请给我示例android代码。

【问题讨论】:

  • This 可能会有所帮助

标签: java android dictionary geo


【解决方案1】:

我使用带有 geoFire 的 firebase db 来解决这个问题。如果您可以从数据库中获取每个点,则可以检查“距离”,例如:

double distance = SphericalUtil.computeDistanceBetween(pointCoordinate, myCoordinate);

来自import com.google.maps.android.SphericalUtil;。 但是如果你有很多点的大数据库,这可能是个问题。

【讨论】:

【解决方案2】:
 double distanceInMiles = Utils.calculateDistanceBetweenGeoPoints(
                                    currentLocation.getLatitude(),
                                    currentLocation.getLongitude(),
                                    otherLatitude,
                                    otherLongitude);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-29
    • 1970-01-01
    • 2021-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多