android - Adding distance to a GPS coordinate -
i'm trying generate points @ random distances away fixed point using gps.
how can add distance in meters gps coordinate? i've looked @ utm gps conversion there simpler method achieve this?
i'm working on android platform in case.
cheers, fgs
- p0(lat0,lon0) : initial position (unit : degrees)
- dx,dy : random offsets initial position in meters
you can use approximation compute position of randomized position:
lat = lat0 + (180/pi)*(dy/6378137) lon = lon0 + (180/pi)*(dx/6378137)/cos(lat0)
this quite precise long random distance offset below 10-100 km
edit: of course in java math.cos() expects radians use math.cos(math.pi/180.0*lat0)
if lat0 in degrees assumed above.
Comments
Post a Comment