【发布时间】:2019-05-04 17:12:48
【问题描述】:
我在 orcle 数据库表中有纬度和经度值列表。 在 Android 应用程序中,我想标记那些在我当前地理位置周围半径值低于 5 公里的位置。我该怎么做? 谁能解决这个问题,请给我示例android代码。
【问题讨论】:
-
This 可能会有所帮助
标签: java android dictionary geo
我在 orcle 数据库表中有纬度和经度值列表。 在 Android 应用程序中,我想标记那些在我当前地理位置周围半径值低于 5 公里的位置。我该怎么做? 谁能解决这个问题,请给我示例android代码。
【问题讨论】:
标签: java android dictionary geo
我使用带有 geoFire 的 firebase db 来解决这个问题。如果您可以从数据库中获取每个点,则可以检查“距离”,例如:
double distance = SphericalUtil.computeDistanceBetween(pointCoordinate, myCoordinate);
来自import com.google.maps.android.SphericalUtil;。
但是如果你有很多点的大数据库,这可能是个问题。
【讨论】:
double distanceInMiles = Utils.calculateDistanceBetweenGeoPoints(
currentLocation.getLatitude(),
currentLocation.getLongitude(),
otherLatitude,
otherLongitude);
【讨论】: