<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>codesofa &#187; google</title>
	<atom:link href="http://codesofa.com/blog/archive/tag/google/feed" rel="self" type="application/rss+xml" />
	<link>http://codesofa.com</link>
	<description>chaotic. pragmatic. smart(ass).</description>
	<lastBuildDate>Wed, 04 Aug 2010 16:05:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>A swiss public transit API (SBB and Google..)</title>
		<link>http://codesofa.com/blog/archive/2008/08/03/a-swiss-public-transit-api-sbb-and-google.html</link>
		<comments>http://codesofa.com/blog/archive/2008/08/03/a-swiss-public-transit-api-sbb-and-google.html#comments</comments>
		<pubDate>Sun, 03 Aug 2008 10:39:02 +0000</pubDate>
		<dc:creator>marc</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Okapi]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[sbb]]></category>
		<category><![CDATA[transit]]></category>

		<guid isPermaLink="false">http://lab.codesofa.com/blog/archive/2008/08/03/a-swiss-public-transit-api-sbb-and-google.html</guid>
		<description><![CDATA[Here we go.. After weeks of going back and forth between a crappy API (sbb.ch) with exact schedule and a nice API with wrong schedule (google.com), I finally merged them into one. What are the capabilities of this API? Let&#8217;s make an example. Given you entered from = &#8220;Feldstrasse 133, Zürich&#8221; and to = &#8220;Bern&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>Here we go.. After weeks of going back and forth between a crappy API (sbb.ch) with exact schedule and a nice API with wrong schedule (google.com), I finally merged them into one.</p>
<p>What are the capabilities of this API? Let&#8217;s make an example.</p>
<p>Given you entered from = &#8220;Feldstrasse 133, Zürich&#8221; and to = &#8220;Bern&#8221;.</p>
<ul>
<li>It then checks sbb.ch first &#8211; No hit.</li>
<li>Then it checks google.com, which will return you a schedule with the next transit station from the address &#8220;feldstrasse+133, Zürich&#8221;</li>
</ul>
<p>Ok, this is not a big deal.</p>
<p>In GottaGo, we often use (or almost everytime) the coordinates of a station. Let&#8217;s make another example.</p>
<p>Query: from=Triemli[8.495521,47.368052,0] and to=&#8221;Feldstrasse 133&#8243;.</p>
<p>The coordinates are then reverse geocoded, so that we get a city name.. Which is &#8220;Zürich&#8221; in this case.</p>
<ul>
<li>The API will first check sbb.ch for &#8220;Zürich, Triemli&#8221; to &#8220;Feldstrasse 133&#8243;, which will be no hit.</li>
<li>It then checks sbb.ch for &#8220;Zürich, Triemli&#8221; to &#8220;Zürich, Feldstrasse 133&#8243;.
<p>Note that the city is also added to the other parameter since we had no hit in the first place and the city name did not yet occur in the second parameter &#8220;Feldstrasse 133&#8243;. But no hit again..</li>
<li>Then it checks google.com for &#8220;Zürich, Triemli&#8221; to &#8220;Feldstrasse 133&#8243;, which will be no hit, since there are a few more &#8220;Feldstrasse&#8221;s around in Switzerland.</li>
<li>Ok, now the last resort: Check google with &#8220;Zürich, Triemli&#8221; to &#8220;Zürich, Feldstrasse 133&#8243; &#8211; Ahhh, finally a hit :)</li>
</ul>
<p>Why all this? Because of POI and address-book search.</p>
<p>SBB.ch doesn&#8217;t really provide a proper API for using POIs and addresses. And google doesn&#8217;t provide the comfort of saying &#8220;Fribourg&#8221; is the Mainstation of &#8220;Fribourg&#8221; and not the center of Fribourg, and the schedule is sometimes wrong, especially during holidays.</p>
<p>This results in a comfortable API which we can use to make also very simples queries like: from &#8220;Current Location&#8221; to &#8220;Liip&#8221; in `GottaGo&#8217;.</p>
<p>The URL to this API? http://couch.codesofa.com/api/transit.xml?from=station[longitude,latitude,0]; station2[longitude,latitude,0]&amp;to=station3; station4[longitude,latitude,0]</p>
<p>(The coordinates are optional, and you can enter as many stations as  you like, separated by &#8220;;&#8221;)</p>
<p>Eg: <a href="http://couch.codesofa.com/api/transit.xml?from=Triemli%5B8.495521,47.368052,0%5D&amp;to=Fribourg">couch.codesofa.com/api/transit.xml?from=Triemli[8.495521,47.368052,0]&amp;to=Bern</a></p>
<p> </p>
<p>Btw.: Latest Beta of `GottaGo&#8217; is out. (An iPhone app for swiss public transit). If you want a preview, see: <a href="http://liip.to/applyforbeta">http://liip.to/applyforbeta</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codesofa.com/blog/archive/2008/08/03/a-swiss-public-transit-api-sbb-and-google.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->