Using Google Map API to Get Latitude/Longitude

Vote 0 Votes

Script Sample:
wget -qO- "台中市中山路1號&output=csv"

(3rd column is latitude, 4th is longitude)

PHP Sample:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$address&output=csv");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo "Latitude: $output[2]
Longitude: $output[3]

Latitude: 24.1371957
Longitude: 120.6842909

ref. Google API 透過 HTTP 進行地理編碼

Leave a comment

About this Entry

This page contains a single entry by Pank published on March 27, 2010 5:22 AM.

UTF-8 CSV for Excel was the previous entry in this blog.

libnss-mysql - System-wide authentication using MySQL is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives