<?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>youdidwhatwithtsql.com &#187; data.gov.uk</title>
	<atom:link href="http://www.youdidwhatwithtsql.com/tag/data-gov-uk/feed" rel="self" type="application/rss+xml" />
	<link>http://www.youdidwhatwithtsql.com</link>
	<description>making DBAs everywhere curse!</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:21:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get TFL Tube data with Powershell</title>
		<link>http://www.youdidwhatwithtsql.com/get-tfl-tube-data-with-powershell/689</link>
		<comments>http://www.youdidwhatwithtsql.com/get-tfl-tube-data-with-powershell/689#comments</comments>
		<pubDate>Sat, 27 Feb 2010 19:18:24 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[Data]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[data.gov.uk]]></category>
		<category><![CDATA[London Datastore]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/get-tfl-tube-data-with-powershell/689</guid>
		<description><![CDATA[The London Datastore has loads of datasets available that we can use for free. One of the datasets available is a list of TFL Station Locations. The station location feed is a geo-coded KML feed of most of London Underground, DLR and London Overground stations. Here&#8217;s Powershell script that will extract this data from a [...]<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/get-tfl-tube-data-with-powershell/689">Get TFL Tube data with Powershell</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://data.london.gov.uk/" target="_blank">London Datastore</a> has loads of datasets available that we can use for free. One of the datasets available is a list of <a href="http://data.london.gov.uk/datastore/package/tfl-station-locations" target="_blank">TFL Station Locations</a>. The station location feed is a geo-coded KML feed of most of London Underground, DLR and London Overground stations. Here&#8217;s <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target="_blank">Powershell</a> script that will extract this data from a url and write it to a pipe-delimited file ready for import into the database of your choice. </p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p689code2'); return false;">View Code</a> POWERSHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6892"><td class="code" id="p689code2"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$xml</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> XML
<span style="color: #800080;">$url</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;http://www.tfl.gov.uk/tfl/syndication/feeds/stations.kml&quot;</span>
<span style="color: #800080;">$csvFile</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;$env:UserProfile\Desktop\tfl_tubes.csv&quot;</span>;
&nbsp;
<span style="color: #008000;"># Empty file if it already exists</span>
<span style="color: #008080; font-weight: bold;">Set-Content</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800080;">$csvFile</span> <span style="color: #800080;">$null</span>;
<span style="color: #008000;"># Add headers to file</span>
<span style="color: #008080; font-weight: bold;">Add-Content</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800080;">$csvFile</span> <span style="color: #800000;">&quot;Station|Address|Coordinates&quot;</span>;
&nbsp;
<span style="color: #008000;"># Load the xml</span>
<span style="color: #800080;">$xml</span>.Load<span style="color: #000000;">&#40;</span><span style="color: #800080;">$url</span><span style="color: #000000;">&#41;</span>;
<span style="color: #800080;">$stations</span> <span style="color: pink;">=</span> <span style="color: #800080;">$xml</span>.kml.Document.Placemark;
&nbsp;
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$station</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$stations</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$name</span> <span style="color: pink;">=</span> <span style="color: #800080;">$station</span>.name;
	<span style="color: #800080;">$description</span> <span style="color: pink;">=</span> <span style="color: #800080;">$station</span>.description;
	<span style="color: #800080;">$coordinates</span> <span style="color: pink;">=</span> <span style="color: #800080;">$station</span>.Point.coordinates
	<span style="color: #008000;"># This data needs cleaning a bit</span>
	<span style="color: #800080;">$name</span> <span style="color: pink;">=</span> <span style="color: #800080;">$name</span>.Trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$description</span> <span style="color: pink;">=</span> <span style="color: #800080;">$description</span>.Trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #800080;">$coordinates</span> <span style="color: pink;">=</span> <span style="color: #800080;">$coordinates</span>.Trim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #008000;"># Ad line to the csv file</span>
	<span style="color: #008080; font-weight: bold;">Add-Content</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800080;">$csvFile</span> <span style="color: #800000;">&quot;$name|$description|$coordinates&quot;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>After running the script check your desktop for a file called <strong>tfl_tubes.csv</strong> which should look something like below.</p>
<p><a href="http://www.youdidwhatwithtsql.com/wp-content/uploads/2010/02/tfl_tubes.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TFL Station Locations csv data file" border="0" alt="tfl tubes thumb Get TFL Tube data with Powershell" src="http://www.youdidwhatwithtsql.com/wp-content/uploads/2010/02/tfl_tubes_thumb.png" width="244" height="183" /></a></p>
<p><map name='google_ad_map_689_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/689?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_689_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=689&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Fget-tfl-tube-data-with-powershell%2F689' title="Get TFL Tube data with Powershell" alt=" Get TFL Tube data with Powershell" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/get-tfl-tube-data-with-powershell/689">Get TFL Tube data with Powershell</a></p>
<div class="none"><div class="g-plusone" data-href="http://www.youdidwhatwithtsql.com/get-tfl-tube-data-with-powershell/689" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/get-tfl-tube-data-with-powershell/689/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>British Government launches free data site</title>
		<link>http://www.youdidwhatwithtsql.com/british-government-launches-free-data-site/560</link>
		<comments>http://www.youdidwhatwithtsql.com/british-government-launches-free-data-site/560#comments</comments>
		<pubDate>Wed, 20 Jan 2010 21:46:14 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[Data]]></category>
		<category><![CDATA[data.gov.uk]]></category>
		<category><![CDATA[free datasets]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/british-government-launches-free-data-site/560</guid>
		<description><![CDATA[Just a quick post about the British Governments launch of data.gov.uk offering free access to a large number of datasets. It&#8217;s good to see this data, that we as taxpayers have funded, available for free use. Hats off to The Guardian&#8217;s long running free our data campaign. The site is being officially launched by Sir [...]<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/british-government-launches-free-data-site/560">British Government launches free data site</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Just a quick post about the British Governments launch of <a href="http://data.gov.uk" target="_blank">data.gov.uk</a> offering free access to a large number of datasets. It&#8217;s good to see this data, that we as taxpayers have funded, available for free use. Hats off to <a href="http://www.guardian.co.uk" target="_blank">The Guardian&#8217;s</a> long running <a href="http://www.guardian.co.uk/technology/free-our-data" target="_blank">free our data</a> campaign.</p>
<p>The site is being officially launched by <a href="http://en.wikipedia.org/wiki/Tim_Berners-Lee" target="_blank">Sir Tim Berners Lee</a> tomorrow, but you can access <a href="http://data.gov.uk" target="_blank">the site</a> now. The US has their own version <a href="http://data.gov" target="_blank">data.gov</a> but the British site boasts nearly three times as many datasets. Take a peek at the <a href="http://data.gov.uk/data/all" target="_blank">available datasets</a>. It always fantastic looking through the great number of <a href="http://data.gov.uk/apps" target="_blank">apps</a> that people create around freely available data. Why not take a look and start your own project?</p>
<p>Those interested in London specific data can check out the <a href="http://data.london.gov.uk/" target="_blank">London DataStore.</a> People in sunny San Francisco have <a href="http://datasf.org/" target="_blank">datasf</a> and Chicago also have a <a href="http://egov.cityofchicago.org/CityData/CityData.html" target="_blank">dataset section</a> on their website. Read <a href="http://www.guardian.co.uk/technology/2010/jan/20/tim-berners-lee-free-data" target="_blank">more about this</a>.</p>
<p><map name='google_ad_map_560_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/560?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_560_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=560&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Fbritish-government-launches-free-data-site%2F560' title="British Government launches free data site" alt=" British Government launches free data site" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/british-government-launches-free-data-site/560">British Government launches free data site</a></p>
<div class="none"><div class="g-plusone" data-href="http://www.youdidwhatwithtsql.com/british-government-launches-free-data-site/560" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/british-government-launches-free-data-site/560/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

