2011-10-11 38 views
0

我開發一個GPS服務器和跟蹤系統:轉換座標轉換成地圖解決

  1. 我如何轉換經度和緯度數據從GPS跟蹤設備鑽進地址數據,使客戶端應用程序報告是顯示道路名稱而不是座標?
  2. 如何映射座標數據,以便在地圖上顯示跟蹤器位置,即谷歌地圖或矢量地圖?

我會非常感謝您的回答或建議

回答

2
+0

感謝。我會通過您建議的網頁鏈接。 –

+0

反向地理編碼器根據您的答案工作。然而,一些跟蹤設備以不同的格式發送座標信息, 0116.8635S,03645.5796E它變得有點強硬以下地址解析器繪製 http://maps.google.com/maps/geo?q="latitude","longtitude"&output=csv&sensor=false 任何建議上如何繪製上述座標將不勝感激。 –

+1

您需要將它們從任何格式轉換爲標準表示法。 – ceejayoz

0

這裏你可以找到How to convert GPS coordinates to a full address with php?

而且在Ruby中:

require 'curb' 

require 'json' 

class GpsUtils 

GOOGLE_MAP_URL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=" 

class << self 

    # Return the address 
    def convert_from_gps_coordinates_to_address(lat, long) 
    response = Curl.get(GOOGLE_MAP_URL + lat + "," + long) 
    json_response = JSON.parse(response.body_str) 
    # Read the full address (formatted_address) from json_response 
    json_response["results"].first["formatted_address"] 
    end 

end 

end 

GpsUtils.convert_from_gps_coordinates_to_address("19.43250", "-99.1330" 
+0

@JuanRicardo:你提出的Ruby解決方案[這裏](http://stackoverflow.com/review/suggested-edits/4939541)* Juan Ricardo * – rubo77