<?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>Help Me Investigate Transport &#187; paulbradshaw</title>
	<atom:link href="http://helpmeinvestigate.com/transport/author/paulbradshaw/feed/" rel="self" type="application/rss+xml" />
	<link>http://helpmeinvestigate.com/transport</link>
	<description>Providing help, connections and resources for those investigating the transport system. Part of the Help Me Investigate network</description>
	<lastBuildDate>Fri, 10 Jan 2014 21:43:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>Mapping bus stops in your local area</title>
		<link>http://helpmeinvestigate.com/transport/mapping-bus-stops-in-your-local-area/</link>
		<comments>http://helpmeinvestigate.com/transport/mapping-bus-stops-in-your-local-area/#comments</comments>
		<pubDate>Fri, 10 Jan 2014 18:35:53 +0000</pubDate>
		<dc:creator><![CDATA[paulbradshaw]]></dc:creator>
				<category><![CDATA[Tips and advice]]></category>
		<category><![CDATA[ATCOcode]]></category>
		<category><![CDATA[Birmingham]]></category>
		<category><![CDATA[Brumtransport]]></category>
		<category><![CDATA[Fusion Tables]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[Pupul Chatterjee]]></category>

		<guid isPermaLink="false">http://helpmeinvestigate.com/transport/?p=10</guid>
		<description><![CDATA[This post was originally published on the general Help Me Investigate blog. Recently I helped Pupul Chatterjee map bus stops in Birmingham for BrumTransport. I thought I&#8217;d share the process here as it demonstrates a number of techniques in filtering data that isn&#8217;t helpfully categorised. Does the data exist? Searching in the right place I started my &#8230; <a href="http://helpmeinvestigate.com/transport/mapping-bus-stops-in-your-local-area/" class="more-link">Continue reading <span class="screen-reader-text">Mapping bus stops in your local area</span> <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>This post was <a href="http://helpmeinvestigate.com/blog/mapping-bus-stops-in-your-local-area/">originally published on the general Help Me Investigate blog</a>.</em></p>
<p>Recently I helped Pupul Chatterjee map <strong>bus stops in Birmingham</strong> for <a href="http://brumtransport.com/">BrumTransport</a>. I thought I&#8217;d share the process here as it demonstrates a number of techniques in filtering data that isn&#8217;t helpfully categorised.<span id="more-10"></span></p>
<h2>Does the data exist? Searching in the right place</h2>
<p>I started my search for bus stop data at <a href="http://research.google.com/tables">Google&#8217;s Tables search engine</a> &#8211; this allows you to search public Google Fusion Tables as well as &#8216;web tables&#8217;. I started with a <a href="http://research.google.com/tables?q=bus+stops">broad search for &#8220;bus stops&#8221;</a> &#8211; the top result looked promising: <a href="http://www.guardian.co.uk/news/datablog/2010/sep/27/uk-transport-national-public-data-repository">a Guardian datablog post on &#8220;<em>Every bus stop, train station, ferry port and taxi rank in Britain</em></a>&#8220;.</p>
<p>That post included a link to a <a href="https://www.google.com/fusiontables/DataSource?snapid=85105">fusion table that mapped those stops</a>, as well as <a href="http://data.gov.uk/dataset/nptdr">the original data on Data.gov.uk</a>.</p>
<p>The question was: how easily could we extract Birmingham bus stops from that?<img title="More..." alt="" src="http://helpmeinvestigate.com/blog/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" /></p>
<h2>Filtering and downloading</h2>
<p>Open the <a href="https://www.google.com/fusiontables/DataSource?snapid=85105">fusion table that mapped those stops</a>. You would hope that one part of the data tells us what type of stop this is (bus, train, etc), and another relates to the town or city that a bus stop lies in. To find out, we need to look at the raw data rather than the map view.</p>
<p>You could <em>download</em> the data, but as there are 400,000 rows, that might take some time. A quicker way is to look at it as a table in Fusion Tables, which you can do by selecting <strong>Visualize &gt; Table.</strong></p>
<p>In that view you can see two columns which might help us: <em>Stop type, name</em>; and <em>NatGazLocality</em>.</p>
<p>To test whether these will work, we can use Fusion Tables&#8217;s filter function. This is opened by selecting <strong>View &gt; Filter</strong>. Once you do this a new tab appears above the table with three elements:</p>
<ol>
<li>A drop-down menu for you to choose which column you want to filter on</li>
<li>A drop-down menu with options for <em>how</em> you want to filter &#8211; for example, whether you want to look within numerical ranges (above, below, between, equals), text matches, and how exact you want to be (matches, contains, contains ignoring case, etc.)</li>
<li>And an open text box for you to type the values you want to filter against, i.e. the number or text</li>
</ol>
<p>On the first drop-down menu select <em>Stop type, name</em>; and on the second select <em>contains ignoring case</em>. In the final box type &#8220;Bus&#8221;&#8230;</p>
<p>&#8230;As the entries in this column are quite consistent, Fusion Tables brings up a suggestion of any entries that match &#8211; there is only one, so you can select that if you wish.</p>
<p><a href="http://helpmeinvestigate.com/blog/wp-content/uploads/2013/07/Screen-Shot-2013-07-26-at-14.59.30.png"><img title="Using the Fusion Tables filter on bus stop data" alt="Using the Fusion Tables filter on bus stop data" src="http://helpmeinvestigate.com/blog/wp-content/uploads/2013/07/Screen-Shot-2013-07-26-at-14.59.30.png" width="447" height="151" /></a></p>
<p>Click <strong>Apply</strong> under the filter and you should see the results.</p>
<p>We also want to narrow on location, so click the link above &#8216;Apply&#8217; that says <strong>Add condition</strong>.</p>
<p>This time on the first drop-down menu select <em>NatGazLocality</em>; and on the second select <em>contains ignoring case</em>. In the final box type &#8220;Birmingham&#8221;. As there are lots of different entries here, Fusion Tables makes no suggestions this time.</p>
<p><a href="http://helpmeinvestigate.com/blog/wp-content/uploads/2013/07/birminghamFilter.png"><img title="Using the Fusion Tables filter on bus stop data" alt="Using the Fusion Tables filter on bus stop data" src="http://helpmeinvestigate.com/blog/wp-content/uploads/2013/07/birminghamFilter.png" width="551" height="181" /></a></p>
<p>Click <strong>Apply</strong> again and you should see the results once more.</p>
<p>A browse down the <em>NatGazLocality</em> column should make you wary: the locations are not all the same: we have <em>Rubery (Birmingham)</em> as well as just <em>Birmingham</em>. To check how comprehensive this data covers Birmingham, it&#8217;s best to switch back to the map view, by selecting <strong>Visualize &gt; Map </strong>and applying the same filters as before.</p>
<p>You&#8217;ll notice &#8211; at least in Birmingham&#8217;s case &#8211; that areas are missing stops. A search in the data for specific stops we know exist shows that their <em>NatGazLocality</em> doesn&#8217;t mention &#8216;Birmingham&#8217; at all, but just the local area name.</p>
<p>We have two options at this point: we can try to compile a list of those local area names and try to match each one. Or we can find some other way of identifying the region in this data.</p>
<h2>Searching for a problem</h2>
<p>At this point I <a href="https://www.google.co.uk/search?q=list+of+bus+stops+birmingham+%22natgazlocality%22">searched for something very specific</a>:</p>
<pre>list of bus stops birmingham "natgazlocality"</pre>
<p>The &#8220;natgazlocality&#8221; part is in quotes because I only wanted webpages that <em>contained</em> that term, rather than pages that may be linked to with it.</p>
<p>There is only one result: <a href="http://www.radicalabacus.org/post/show/importing_csv_bus_stop_data">this post on importing bus stop data</a> by Geoff Mackenzie, which happens to mention Birmingham. A scan of the post throws up this key passage:</p>
<blockquote><p>The <code>ATCOCode</code> seems quite often to work as a key to look up <a href="http://nextbuses.mobi/" target="_blank">NextBuses</a> for a particular stop and appears to be unique (although until we actually chew through the data it’s always possible it’ll surprise us and have one or more special cases with missing codes or duplicates so it might not be a good idea to depend on the uniqueness of these codes). <strong>The first three characters of this code (usually, maybe always numeric) can be associated with regions</strong> as well; I have a Microsoft Word file as well which provides at least some of these mappings. Not all of these are actually regions though – there are other interpretations of these codes for national services like air.</p></blockquote>
<p>The part in bold is what we needed: the ATCOcode field may be able to help identify stops within a region.</p>
<h2>Testing the hypothesis</h2>
<p>At this point we don&#8217;t know which ATCO codes may relate to our region. To get an idea, we can look at the results which have &#8216;Birmingham&#8217; in the <em>NatGazLocality </em>field again, this time focusing on that <em>ATCOCode</em> field.</p>
<p>With that filter applied, you can click on <strong>File &gt; Download</strong> to download <em>only </em> the matching results and analyse them in Excel. There are a number of ways of doing this, but perhaps the simplest is to sort your data on that field and scan down to see how the first few characters change, if at all.</p>
<p>It turns out these results always begin with the four characters 4300 or 2000.</p>
<p>We can use our filter again to test whether that will help us find the data we need.</p>
<p>Back in Fusion Tables, make sure you are in the map visualisation and this time use the filter on <em>ATCOCode </em>with <em>starts with</em> and 4300.</p>
<p><a href="http://helpmeinvestigate.com/blog/wp-content/uploads/2013/07/BirminghamMap.png"><img alt="BirminghamMap" src="http://helpmeinvestigate.com/blog/wp-content/uploads/2013/07/BirminghamMap.png" width="700" height="431" /></a></p>
<p>You should be able to see at a glance where the results fall &#8211; and indeed this time there is a clear pattern: the stops are around in the West Midlands &#8211; Wolverhampton, the Black Country, Birmingham and Coventry &#8211; and include stops that we couldn&#8217;t see before.</p>
<p>Trying the same process with 2000 brings up stops in an area further south: Kidderminster, Bromsgrove, Redditch.</p>
<p>We could choose one or the other, or to combine the two &#8211; but we finally have our data.</p>
]]></content:encoded>
			<wfw:commentRss>http://helpmeinvestigate.com/transport/mapping-bus-stops-in-your-local-area/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
