Category Archives: Geolocation

[Google Maps Geocoding] ลอง Parse Json ด้วย Groovy + Java (Netbeans)

โปรเจ็คตลกๆมาอีกแล้ว  เพราะโปรเจ็คนี้ผมใช้  Json Lib + Groovy + Java แต่ผมใช้ Groovy ดึง json (URL.text) แล้วใช้ Java เป็นตัวแกะ jsonObject เป็น jsonArray หลังจากนั้นเอาข้อมูลโยนกลับไปให้ Groovy ถอดเอาเฉพาะส่วนที่ต้องการออกมา (ในที่นี้คือ coordinates — latitude ,longitude นั่นแหละ) ดูวุ่นวายมาก ทั้งๆที่ เขียน Groovy อย่างเดียวก็ได้ เพราะ Json Lib ก็ลองรับ groovy  หรือจะเขียน Java เพียวๆ เลยก็ได้  … Continue reading

Reverse Geocoding (Address Lookup) ผ่าน http

ลองเล่น Reverse Geocoding ของ google map api ซักกะหน่อย     Reverse Geocoding คือการ เปลี่ยนชื่อสถานที่เป็นพิกัด (latitude , longitude) นั่นเอง  (ความจริงมันได้ข้อมูลอื่นๆมาด้วยอีกเยอะ)   วิธีทำก็ไปอ่านดูได้ที่ Reverse Geocoding (Address Lookup)   หรือจะลองทำเลย  ก็แค่  Request ไปที่ http://maps.google.co.th/maps/geo?q=Thammasat&output=json&sensor=falsegl=th ก็จะได้ข้อมูลมาประมาณนี้ { "name": "Thammasat Rangsit", "Status": { "code": 200, "request": "geocode" }, … Continue reading

เทคโนโลยีด้านการระบุตำแหน่งของผู้ส่งข้อมูล (ใช้ Geolocation API )

ขอ blog จากเอกสารบางส่วนที่ส่ง NSC ไปหน่อย เผื่อมีประโยชน์กับท่านอื่นด้วย ว่าด้วยเรื่องของการดึงข้อมูลพิกัดผ่านทาง Browser  (ดึงพิกัดออกมาจากมือถือนั่นแล)   การดึงพิกัดจากมือถือ ทำได้โยการใช้ Geolocation API   ซึ่งส่วนสำคัญที่ใช้ในโครงงานนี้คือ Coordinates interface ซึ่งมีรายละเอียดดังนี้ interface Coordinates { readonly attribute double latitude; readonly attribute double longitude; readonly attribute double? altitude; readonly attribute double accuracy; readonly attribute … Continue reading