<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Synthesis: google maps api</title>
    <link>http://synthesis.sbecker.net/articles/2005/11/11/google-maps-api</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>by Scott Becker</description>
    <item>
      <title>google maps api</title>
      <description>&lt;p&gt;I started messing around with the Google Maps &lt;span class="caps"&gt;API&lt;/span&gt; today. Seeing all these &amp;#8220;mash-ups&amp;#8221; has convinced me that it must not be that hard, and it isn&amp;#8217;t!&lt;/p&gt;


	&lt;p&gt;One thing you quickly discover is that google doesn&amp;#8217;t supply you with a built-in way to translate an address into lat/long coordinates &amp;#8211; the input they accept in order to plot points on the map.&lt;/p&gt;


	&lt;p&gt;So, I search for ways to do that, and find  &lt;a href="http://ejohn.org/projects/gaddress/"&gt;an article by John Resig that shows how to use perl to create a proxy to GeoCoder.us&lt;/a&gt;. That was exactly what I needed, except I needed it in C#. I bet if I searched harder, I could&amp;#8217;ve found something, but it was pretty quick to whip it up myself, so here&amp;#8217;s the code to do it:&lt;/p&gt;


&lt;pre&gt;
double geoLat;
double geoLong;

// Address of Google
string address="1600 Amphitheatre Parkway,  Mountain View CA 94043";

string url = "http://rpc.geocoder.us/service/rest?address=";

XmlTextReader reader = new XmlTextReader(url + address);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(reader);

XmlNodeList gPoints = xmlDoc.GetElementsByTagName("geo:Point");

geoLat = Double.Parse(gPoints[0]["geo:lat"].InnerText);
geoLong = Double.Parse(gPoints[0]["geo:long"].InnerText);
&lt;/pre&gt;</description>
      <pubDate>Fri, 11 Nov 2005 12:12:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:f314dc50d34930d896e343760e1ed926</guid>
      <author>sbecker</author>
      <link>http://synthesis.sbecker.net/articles/2005/11/11/google-maps-api</link>
      <category>Microsoft</category>
    </item>
    <item>
      <title>"google maps api" by Robert Bousquet</title>
      <description>You might want to try Cartographer ( &lt;a href="http://cartographer.rubyforge.org/"&gt;http://cartographer.rubyforge.org/&lt;/a&gt;), the Google Maps api plugin for Rails. </description>
      <pubDate>Mon, 06 Mar 2006 10:46:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://synthesis.sbecker.net/articles/2005/11/11/google-maps-api#comment-33</link>
    </item>
  </channel>
</rss>
