<?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>Michael Sheldon&#039;s Stuff</title>
	<atom:link href="http://blog.mikeasoft.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mikeasoft.com</link>
	<description></description>
	<lastBuildDate>Wed, 16 May 2012 19:53:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Those Funny Funguloids</title>
		<link>http://blog.mikeasoft.com/2012/05/16/those-funny-funguloids/</link>
		<comments>http://blog.mikeasoft.com/2012/05/16/those-funny-funguloids/#comments</comments>
		<pubDate>Wed, 16 May 2012 12:23:37 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[funguloids]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[harmattan]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[n9]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[ogre3d]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=375</guid>
		<description><![CDATA[Overview Recently I&#8217;ve spent a little time getting the Ogre3D engine into a state where it&#8217;ll work on the Nokia N9 and N950 MeeGo phones. To test the port out a bit more extensively I decided it&#8217;d be a good idea to try porting an existing game, at which point rzr suggested Those Funny Funguloids. [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<h3>Overview</h3>
<p> Recently I&#8217;ve spent a little time getting the <a href='http://www.ogre3d.org'>Ogre3D engine</a> into a state where it&#8217;ll work on the <a href='http://swipe.nokia.com'>Nokia N9 and N950</a> MeeGo phones.</p>
<p> To test the port out a bit more extensively I decided it&#8217;d be a good idea to try porting an existing game, at which point <a href='http://rzr.online.fr'>rzr</a> suggested <a href='http://funguloids.sf.net'>Those Funny Funguloids</a>. So after a fair amount of hacking to make it compatible with my version of Ogre and to make the controls work reasonably on a touch screen device I have a playable version.</p>
<p> The aim of the game is to collect mushrooms (&#8230;<b>IN SPACE</b>), and bring them back to your base without running into any asteroids. Only mushrooms of the same colour as your base are added to your score and your base changes colour each level (but you can hang on to mushrooms between levels and score them later). The controls are fairly simple, touch the left side of the screen to turn left, the right side to turn right and the middle to start moving.</p>
<p> When I have a bit more time I&#8217;ll see about writing a little tutorial on making use of my modified version of Ogre3D to create 3D applications and games in a way that&#8217;s easy to distribute.</p>
<h3>Screenshots</h3>
<p><center><br />
<a style="margin-right: 2em;" href="http://mikeasoft.com/~mike/funguloids-n9-title.png"><img alt="Funguloids menu screen" src="http://mikeasoft.com/~mike/funguloids-n9-title-small.png" title="Funguloids Title" class="alignnone" width="320" height="180" /></a><a href="http://mikeasoft.com/~mike/funguloids-n9-start.png"><img alt="Funguloids menu screen" src="http://mikeasoft.com/~mike/funguloids-n9-start-small.png" title="Funguloids Title" class="alignnone" width="320" height="180" /></a><br />
</center><br />
</p>
<h3>Video</h3>
<p><center><br />
<iframe width="640" height="360" src="http://www.youtube.com/embed/erWj_Q6LEcY" frameborder="0" allowfullscreen></iframe></p>
<p><a href='http://www.youtube.com/watch?v=erWj_Q6LEcY'>Video of gameplay</a><br />
</center></p>
<h3>Download</h3>
<p><a href='http://mikeasoft.com/~mike/funguloids_1.06-2_armel.deb'>funguloids_1.06-2_armel.deb</a></p>
<h3>Source</h3>
<p><a href='http://mikeasoft.com/~mike/funguloids-1.06-meego.tar.gz'>Modified version of Funguloids 1.06</a><br />
<a href='http://mikeasoft.com/~mike/ogre-1.7.4-meego.tar.gz'>Modified version of Ogre 1.7.4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2012/05/16/those-funny-funguloids/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Seagull Strike</title>
		<link>http://blog.mikeasoft.com/2012/04/27/seagull-strike/</link>
		<comments>http://blog.mikeasoft.com/2012/04/27/seagull-strike/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 17:58:01 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[box2d]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[qml]]></category>
		<category><![CDATA[Seagull Strike]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=346</guid>
		<description><![CDATA[Overview A while back a wrote a little game for the Nokia N9 and N950, mostly as a way to explore the QML Box2D bindings. However, whilst packaging up my StatusNet client I thought I might as well release this as well since it can be a fairly enjoyable distraction. Below is a short video [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<h3>Overview</h3>
<p>A while back a wrote a little game for the Nokia N9 and N950, mostly as a way to explore the <a href='https://gitorious.org/qml-box2d'>QML Box2D bindings</a>. However, whilst packaging up my <a href='http://blog.mikeasoft.com/tag/statusnet-meego'>StatusNet client</a> I thought I might as well release this as well since it can be a fairly enjoyable distraction. Below is a short video demonstrating how it works, and at the end of the post you can find details on where to get hold of it.</p>
<p><center><br />
<video width="640" height="360" src="http://mikeasoft.com/~mike/seagullstrike.webm" controls><a href='http://mikeasoft.com/~mike/seagullstrike.webm'>Video</a></video></center><br />
</p>
<h3>Download</h3>
<p>You can either download it via <a href='http://apps.formeego.org'>Apps for Meego</a>, or get hold of the package directly here: <a href='http://mikeasoft.com/~mike/seagullstrike_0.1-2_armel.deb'>http://mikeasoft.com/~mike/seagullstrike_0.1-2_armel.deb</a>.</p>
<h3>Source</h3>
<p>License: <a href='http://www.gnu.org/copyleft/gpl.html'>GPL version 3.0 or later</a><br />
Gitorious repository: <a href='https://gitorious.org/seagull-strike'>https://gitorious.org/seagull-strike</a><br />
Ohloh project page: <a href='https://www.ohloh.net/p/seagull-strike'>https://www.ohloh.net/p/seagull-strike</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2012/04/27/seagull-strike/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://mikeasoft.com/~mike/seagullstrike.webm" length="2814569" type="video/webm" />
		</item>
		<item>
		<title>StatusNet for MeeGo 0.2.1</title>
		<link>http://blog.mikeasoft.com/2012/04/26/statusnet-for-meego-0-2-1/</link>
		<comments>http://blog.mikeasoft.com/2012/04/26/statusnet-for-meego-0-2-1/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 00:57:58 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[identi.ca]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[statusnet]]></category>
		<category><![CDATA[StatusNet for MeeGo]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=335</guid>
		<description><![CDATA[Overview StatusNet for MeeGo makes it possible for Nokia N9, N950 and similar phones to connect to StatusNet compatible microblogging services such as Identi.ca. It supports viewing statuses in the phone’s event feed alongside Twitter and Facebook updates, viewing conversations, posting new status updates and replying to other people. New Features Support for followings links [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="StatusNet for MeeGo displaying clickable links" src="http://mikeasoft.com/~mike/statusnet_meego_links.png" title="StatusNet for MeeGo displaying clickable links" class="alignright" width="480" height="145" style="float: right; margin-left: 1em; margin-bottom: 1em;" /></p>
<h3>Overview</h3>
<p>StatusNet for MeeGo makes it possible for Nokia N9, N950 and similar phones to connect to <a href='http://status.net'>StatusNet</a> compatible microblogging services such as <a href='http://identi.ca'>Identi.ca</a>. It supports viewing statuses in the phone’s event feed alongside Twitter and Facebook updates, viewing conversations, posting new status updates and replying to other people.</p>
<h3>New Features</h3>
<ul>
<li>Support for followings links in posts.</li>
<li>Links to groups, tags, and users.</li>
<li>Support for posting messages using UTF-8 characters.</li>
<li>Slight improvements to the clarity of the login screen.</li>
</ul>
<h3>Download</h3>
<p>Ovi Store: <a href='http://store.ovi.com/content/271186'>StatusNet for MeeGo</a><br />
Direct download: <a href="http://mikeasoft.com/~mike/statusnet-meego_0.2.1-1_armel.deb">statusnet-meego_0.2.1-1_armel.deb</a></p>
<h3>Source</h3>
<p>License: <a href='http://www.gnu.org/copyleft/gpl.html'>GPL version 3.0 or later</a><br />
Gitorious repository: <a href='https://gitorious.org/statusnet-meego-plugin'>https://gitorious.org/statusnet-meego-plugin</a><br />
Ohloh project page: <a href='https://www.ohloh.net/p/statusnet-meego'>https://www.ohloh.net/p/statusnet-meego</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2012/04/26/statusnet-for-meego-0-2-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>StatusNet for MeeGo 0.2</title>
		<link>http://blog.mikeasoft.com/2012/04/07/statusnet-for-meego-0-2/</link>
		<comments>http://blog.mikeasoft.com/2012/04/07/statusnet-for-meego-0-2/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 00:45:47 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[identi.ca]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[statusnet]]></category>
		<category><![CDATA[StatusNet for MeeGo]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=311</guid>
		<description><![CDATA[Overview StatusNet for MeeGo makes it possible for Nokia N9, N950 and similar phones to connect to StatusNet compatible microblogging services such as Identi.ca. It supports viewing statuses in the phone&#8217;s event feed alongside Twitter and Facebook updates, viewing conversations, posting new status updates and replying to other people. Assuming no issues are encountered by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mikeasoft.com/~mike/statusnet-meego-posting.png"><img alt="StatusNet for MeeGo sending messages and replies" src="http://mikeasoft.com/~mike/statusnet-meego-posting-small.png" title="StatusNet for MeeGo sending messages and replies " style="float: right;" class="alignright" width="303" height="539" /></a></p>
<h3>Overview</h3>
<p>StatusNet for MeeGo makes it possible for Nokia N9, N950 and similar phones to connect to <a href='http://status.net'>StatusNet</a> compatible microblogging services such as <a href='http://identi.ca'>Identi.ca</a>. It supports viewing statuses in the phone&#8217;s event feed alongside Twitter and Facebook updates, viewing conversations, posting new status updates and replying to other people.</p>
<p>Assuming no issues are encountered by testers I plan on submitting this version to the <a href='http://apps.formeego.org/'>Apps For MeeGo</a> repository, and later also the Nokia Ovi Store.</p>
<p>You&#8217;ll need to restart your phone before statuses start appearing in the events feed, although you&#8217;ll be able to use the main app straight away. Because of some changes in the dbus services its also necessary to restart your phone even if you&#8217;ve already installed version 0.1 (this won&#8217;t be needed after future updates though).</p>
<h3>New features</h3>
<ul>
<li>Posting updates.</li>
<li>Posting replies.</li>
<li>Viewing messages in the application.</li>
<li>Display full conversations.</li>
<li>Load additional statuses from earlier in time.</li>
<li>Splash screen while connecting.</li>
<li>Improved dbus handling.</li>
<li>Asynchronous message loading and posting.</li>
</ul>
<h3>Planned features</h3>
<ul>
<li>Support for displaying rich content (pictures, videos, etc.)</li>
<li>Ability to mark statuses as being &#8220;favourites&#8221;.</li>
<li>Option to subscribe to new users in the app.</li>
</ul>
<h3>Download</h3>
<p>Ovi Store: <a href='http://store.ovi.com/content/271186'>StatusNet for MeeGo</a><br />
Direct download: <a href='http://mikeasoft.com/~mike/statusnet-meego_0.2-4_armel.deb'>statusnet-meego_0.2-4_armel.deb</a></p>
<h3>Source</h3>
<p>License: <a href='http://www.gnu.org/copyleft/gpl.html'>GPL version 3.0 or later</a><br />
Gitorious repository: <a href='https://gitorious.org/statusnet-meego-plugin'>https://gitorious.org/statusnet-meego-plugin</a><br />
Ohloh project page: <a href='https://www.ohloh.net/p/statusnet-meego'>https://www.ohloh.net/p/statusnet-meego</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2012/04/07/statusnet-for-meego-0-2/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>StatusNet client for the Nokia N9/N950</title>
		<link>http://blog.mikeasoft.com/2012/04/03/statusnet-client-for-the-nokia-n9n950/</link>
		<comments>http://blog.mikeasoft.com/2012/04/03/statusnet-client-for-the-nokia-n9n950/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 15:58:04 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[identi.ca]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[n9]]></category>
		<category><![CDATA[n950]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[statusnet]]></category>
		<category><![CDATA[StatusNet for MeeGo]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=293</guid>
		<description><![CDATA[There&#8217;s one thing that my Nokia N950 has been lacking and that&#8217;s a StatusNet client, so I set about hacking one together. I love the way that the N9/N950 events feed displays messages from Twitter and Facebook, so my main focus so far has been to integrate with this. I&#8217;ve now got my client to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.mikeasoft.com/wp-content/uploads/2012/04/statusnet-meego.png"><img src="http://blog.mikeasoft.com/wp-content/uploads/2012/04/statusnet-meego.png" alt="StatusNet messages in the MeeGo events feed" title="StatusNet messages in the MeeGo events feed" width="390" height="693" style="float: right; margin: 1em;" class="alignright size-full wp-image-294" /></a></p>
<p>There&#8217;s one thing that my Nokia N950 has been lacking and that&#8217;s a <a href='http://status.net'>StatusNet</a> client, so I set about hacking one together. I love the way that the N9/N950 events feed displays messages from Twitter and Facebook, so my main focus so far has been to integrate with this. I&#8217;ve now got my client to a stage at which it covers most of my own needs so I thought I&#8217;d make an early release for others to play with.</p>
<p>Once I&#8217;ve extended it a little further I plan on submitting it to both <a href='http://apps.formeego.org/'>Apps For Meego</a> and the general Nokia Ovi Store, but for now you can download the Debian package directly <a href='#download'>here</a>.</p>
<p>One thing to note is that you will need to restart your phone before events will start to appear (this is due to a limitation in the way the SyncFW framework loads plugins).</p>
<p>The client is written mostly in Python, with a little C++ for integrating with the events synchronisation framework. It makes use of the StatusNet module written for the command line StatusNet client <a href='http://identicurse.net/'>IdentiCurse</a> and the <a href='http://thp.io/2011/eventfeed/'>python-eventfeed module</a> written by <a href='http://thp.io/'>Thomas Perl</a>.</p>
<h3>Features</h3>
<p>* OAuth login for <a href='http://identi.ca'>identi.ca</a>.<br />
* Standard login for any other StatusNet services.<br />
* Shows messages in the events feed.<br />
* Fetches (and caches) user avatars.<br />
* Displays messages from the events feed in the browser when clicked.<br />
* Automatically fetches new messages in the events feed based on your events feed preferences.<br />
* Can manually fetch new messages via the events feed &#8216;Refresh&#8217; button.</p>
<h3>Not yet implemented</h3>
<p>* Posting messages.<br />
* Displaying messages locally within the application.<br />
* Displaying rich content (messages with multimedia attachments)</p>
<h3 id='download'>Download</h3>
<p>Ovi Store: <a href='http://store.ovi.com/content/271186'>StatusNet for MeeGo</a><br />
Direct download: <a href='http://mikeasoft.com/~mike/statusnet-meego_0.1-3_armel.deb'>statusnet-meego_0.1-3_armel.deb</a></p>
<h3>Source</h3>
<p>License: <a href='http://www.gnu.org/copyleft/gpl.html'>GPL version 3.0 or later</a><br />
Gitorious repository: <a href='https://gitorious.org/statusnet-meego-plugin'>https://gitorious.org/statusnet-meego-plugin</a><br />
Ohloh project page: <a href='https://www.ohloh.net/p/statusnet-meego'>https://www.ohloh.net/p/statusnet-meego</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2012/04/03/statusnet-client-for-the-nokia-n9n950/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Box2D and Box2D-QML for Harmattan</title>
		<link>http://blog.mikeasoft.com/2011/07/15/box2d-and-box2d-qml-for-harmattan/</link>
		<comments>http://blog.mikeasoft.com/2011/07/15/box2d-and-box2d-qml-for-harmattan/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 16:44:19 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[box2d]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[n9]]></category>
		<category><![CDATA[n950]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=281</guid>
		<description><![CDATA[I&#8217;ve just built some Box2D and Box2D-QML packages for Harmattan. The Box2D-QML package is especially interesting, this wraps the Box2D API as QObjects allowing them to be made use of directly from within QML. So you don&#8217;t need any extra C++ to handle physics simulation for simple games or similar. Here&#8217;s a short video of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just built some <a href="http://www.box2d.org/">Box2D</a> and <a href="https://gitorious.org/qml-box2d">Box2D-QML</a> packages for Harmattan. The Box2D-QML package is especially interesting, this wraps the Box2D API as QObjects allowing them to be made use of directly from within QML. So you don&#8217;t need any extra C++ to handle physics simulation for simple games or similar. Here&#8217;s a short video of one of the demos running on an N950:</p>
<p><center><video src="http://mikeasoft.com/~mike/box2d-qml-n950.ogv" controls><a href="http://mikeasoft.com/~mike/box2d-qml-n950.ogv">http://mikeasoft.com/~mike/box2d-qml-n950.ogv</a></video></center></p>
<p>The source code for the above demo can be seen in the Box2D-QML repository here: <a href="https://gitorious.org/qml-box2d/qml-box2d/trees/master/examples/monera">Monera Example</a> and thanks to these wrappers is very simple.</p>
<p>Packages for the N9/N950 can be found in my OBS repository, simply download <a href="http://mikeasoft.com/~mike/elleo.list">elleo.list</a> into <i>/etc/apt/sources.list.d/</i> and run <i>apt-get update</i> to make the repository available on your device, or just download the packages you&#8217;re interested in directly from <a href="http://repo.pub.meego.com/home:/elleo/Harmattan/armel/">http://repo.pub.meego.com/home:/elleo/Harmattan/armel/</a>. </p>
<p>Many thanks to the Box2D and Box2D-QML teams for creating such nice tools, I&#8217;d certainly recommend them to anyone interested in 2D game development on the N9/N950 phones.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2011/07/15/box2d-and-box2d-qml-for-harmattan/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://mikeasoft.com/~mike/box2d-qml-n950.ogv" length="3194565" type="video/ogg" />
		</item>
		<item>
		<title>Libre.fm Radio Client for MeeGo Under Development</title>
		<link>http://blog.mikeasoft.com/2011/07/02/libre-fm-radio-client-for-meego-under-development/</link>
		<comments>http://blog.mikeasoft.com/2011/07/02/libre-fm-radio-client-for-meego-under-development/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 13:08:45 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[gnufm]]></category>
		<category><![CDATA[libre.fm]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[MeeGo]]></category>
		<category><![CDATA[n9]]></category>
		<category><![CDATA[n950]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=268</guid>
		<description><![CDATA[Last week I got the news that I&#8217;d been accepted into Nokia&#8217;s community device program and would be receiving a Nokia N950 so that I could help produce some nice open source MeeGo apps ready for the launch of the Nokia N9 later in the year. The device hasn&#8217;t arrived yet, but I&#8217;ve already started [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I got the news that I&#8217;d been accepted into Nokia&#8217;s <a href='https://meego.com/community/device-program/devices/nokia-n9-devkit'>community device program</a> and would be receiving a Nokia N950 so that I could help produce some nice open source <a href="http://meego.com">MeeGo</a> apps ready for the launch of the <a href="http://swipe.nokia.com">Nokia N9</a> later in the year. The device hasn&#8217;t arrived yet, but I&#8217;ve already started on the first of my projects which is to create a <a href="http://libre.fm">Libre.fm</a> radio client. Most of the basic functionality now works including authentication, tuning to stations, playing, pausing and skipping back and forth through the playlist. I won&#8217;t be making a release until after I&#8217;ve had a chance to actually test it on the device itself, but the code is all in the <a href='http://gitorious.org/foocorp/gnu-fm'>GNU FM git repository</a>. Here&#8217;s a quick video of it in action:<br />
<br />
<center><video src="http://mikeasoft.com/~mike/librefm-meego.ogv" width="864" height="480" controls><a href='http://mikeasoft.com/~mike/librefm-meego.ogv'>Demo Video</a></video></center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2011/07/02/libre-fm-radio-client-for-meego-under-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://mikeasoft.com/~mike/librefm-meego.ogv" length="3034025" type="video/ogg" />
		</item>
		<item>
		<title>Free (as in GPL2) translation dictionaries for the Kindle</title>
		<link>http://blog.mikeasoft.com/2011/01/05/free-as-in-gpl2-translation-dictionaries-for-the-kindle/</link>
		<comments>http://blog.mikeasoft.com/2011/01/05/free-as-in-gpl2-translation-dictionaries-for-the-kindle/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:52:04 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=247</guid>
		<description><![CDATA[Update: All dictionaries except for Welsh and Esperanto (which aren&#8217;t supported by kindlegen) have been updated to work with the Kindle 4. I&#8217;ve had a Kindle for a little while and really like it, but one of the areas it seems to be somewhat lacking in is the availability of translation dictionaries, as such I [...]]]></description>
			<content:encoded><![CDATA[<p><i><b>Update:</b> All dictionaries except for Welsh and Esperanto (which aren&#8217;t supported by kindlegen) have been updated to work with the Kindle 4.</i></p>
<p>I&#8217;ve had a Kindle for a little while and really like it, but one of the areas it seems to be somewhat lacking in is the availability of translation dictionaries, as such I knocked up a quick script to convert TinyLex dictionaries from the <a href='http://xixona.dlsi.ua.es/apertium-www/'>Apertium project</a> into indexed Kindle dictionaries. The most useful of these is probably the German &#8211; English dictionaries as these are <i>very</i> complete (over 160,000 entries).</p>
<p>One thing that I find quite useful is setting the German -> English dictionary as my primary dictionary (<a href='#instructions'>instructions below</a>) then opening the English -> German dictionary and searching for words (or vice versa), this way you can get an instant re-translation of any words suggested to you.</p>
<h3 id='instructions'>Installation</h3>
<h4>Kindle 3</h4>
<ol>
<li>Download whichever dictionary you&#8217;re interested in from the list <a href='#dictionaries'>below</a>.</li>
<li>Transfer the file across to your Kindle as normal.</li>
<li>Press the <strong>menu key</strong> on your Kindle.</li>
<li>Select <strong>Settings</strong>.</li>
<li>Press the <strong>menu key</strong> again.</li>
<li>Select <strong>Change Primary Dictionary</strong>.</li>
<li>Select your new dictionary from the list.</li>
</ol>
<h4>Kindle 4</h4>
<ol>
<li>Download whichever dictionary you&#8217;re interested in from the list <a href='#dictionaries'>below</a>.</li>
<li>Transfer the file across to your Kindle as normal.</li>
</ol>
<p>If this is the only dictionary you have for this language you&#8217;re now done. If you have multiple dictionaries continue:</p>
<ol>
<li>Press the <strong>menu key</strong> on your Kindle.</li>
<li>Select <strong>Settings</strong>.</li>
<li>Select <strong>edit</strong> next to <strong>Dictionaries</strong> on the second page.</li>
<li>Select the language you wish to set the dictionary for.</li>
<li>Select your new dictionary from the list.</li>
</ol>
<h3 id='dictionaries'>Afrikaans</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-Afrikaans.mobi'>English -> Afrikaans</a> <em>5165 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/Afrikaans-English.mobi'>Afrikaans -> English</a> <em>5195 entries</em></p>
<h3>Esperanto</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-Esperanto.mobi'>English -> Esperanto</a> <em>12344 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/Esperanto-English.mobi'>Esperanto -> English</a> <em>21316 entries</em></p>
<h3>French</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-French.mobi'>English -> French</a> <em>6315 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/French-English.mobi'>French -> English</a> <em>6304 entries</em></p>
<h3>German (includes phrases)</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-German.mobi'>English -> German</a> <em>162004 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/German-English.mobi'>German -> English</a> <em>166733 entries</em></p>
<h3>Polish</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-Polish.mobi'>English -> Polish</a> <em>8107 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/Polish-English.mobi'>Polish -> English</a> <em>9373 entries</em></p>
<h3>Portuguese</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-Portuguese.mobi'>English -> Portuguese</a> <em>4759 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/Portuguese-English.mobi'>Portuguese -> English</a> <em>4609 entries</em></p>
<h3>Spanish</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-Spanish.mobi'>English -> Spanish</a> <em>8488 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/Spanish-English.mobi'>Spanish -> English</a> <em>8769 entries</em></p>
<h3>Welsh</h3>
<p><a href='http://mikeasoft.com/~mike/kindle-dicts/English-Welsh.mobi'>English -> Welsh</a> <em>6674 entries</em><br />
<a href='http://mikeasoft.com/~mike/kindle-dicts/Welsh-English.mobi'>Welsh -> English</a> <em>8632 entries</em></p>
<h3>Scripts</h3>
<p> For those of you interested in the scripts used to generate these dictionaries, they can now be downloaded here: <a href='http://mikeasoft.com/~mike/kindle-dict.tar.gz'>kindle-dict.tar.gz</a>.</p>
<p> Most of the heavy lifting is done by the tab2opf.py script from <a href='www.klokan.cz/projects/stardict-lingea/'>StarDict-Lingea</a>, the tinylex.sh script will do the necessary conversion to get a tinylex dictionary into a tab delimited format suitable for use by tab2opf.py, it&#8217;ll then run tab2opf.py and <a href='http://www.amazon.com/gp/feature.html?ie=UTF8&#038;docId=1000234621'>kindlegen</a> on the output, providing you with a Mobipocket dictionary for use with the Kindle. See the README for more in depth instructions on how to make use of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2011/01/05/free-as-in-gpl2-translation-dictionaries-for-the-kindle/feed/</wfw:commentRss>
		<slash:comments>137</slash:comments>
		</item>
		<item>
		<title>Libre Droid 1.4 Released</title>
		<link>http://blog.mikeasoft.com/2010/10/16/libre-droid-1-4-released/</link>
		<comments>http://blog.mikeasoft.com/2010/10/16/libre-droid-1-4-released/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 20:58:21 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[cc]]></category>
		<category><![CDATA[creative commons]]></category>
		<category><![CDATA[creativecommons]]></category>
		<category><![CDATA[libre.fm]]></category>
		<category><![CDATA[libredroid]]></category>
		<category><![CDATA[librefm]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=238</guid>
		<description><![CDATA[I&#8217;ve just released a new version of Libre Droid onto the Android Market (also downloadable here: http://mikeasoft.com/~mike/libredroid-1.4.apk). The main changes in this release are: Android 2.2 (Froyo) support &#8211; Previous versions didn&#8217;t work under Froyo due to the new streaming framework (libstagefright) not supporting HTTP redirection, so resolving the final URL is now handled by [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released a new version of Libre Droid onto the Android Market (also downloadable here: <a href="http://mikeasoft.com/~mike/libredroid-1.4.apk">http://mikeasoft.com/~mike/libredroid-1.4.apk</a>). The main changes in this release are:</p>
<ul>
<li><b>Android 2.2 (Froyo) support</b> &#8211; Previous versions didn&#8217;t work under Froyo due to the new streaming framework (libstagefright) not supporting HTTP redirection, so resolving the final URL is now handled by Libre Droid itself.</li>
<li><b>Ability to add custom tag stations</b> &#8211; You&#8217;re no longer restricted to the preset tag stations so if you want to listen to <a href="http://alpha.libre.fm/listen.php?tag=Female+Vocals">female vocals</a>, <a href="http://alpha.libre.fm/listen.php?tag=Finger+Picked">finger picked guitar</a>, <a href="http://alpha.libre.fm/listen.php?tag=Monkeys">monkeys</a> or anything else our music might be tagged with then you can create a dedicated station for it.</li>
<li><b>Support for playing a user&#8217;s loved station</b> &#8211; All the music you&#8217;ve ever loved in one easy station.</li>
<li><b>Support for the community loved station</b> &#8211; The Libre.fm community&#8217;s favourite music, this is a selection of all the music that&#8217;s ever been loved by any of our users with the most popular tracks playing most frequently.</li>
<li><b>New artwork.</b></li>
<li><b>Plus a few miscellaneous bug fixes.</b></li>
</ul>
<p><center><img src="http://mikeasoft.com/~mike/libredroid1.4-1.png" alt="New menu page in Libre Droid" /></center></p>
<p><center><img src="http://mikeasoft.com/~mike/libredroid1.4-2.png" alt="Libre Droid playing some music" /></center></p>
<p>To access it directly on your phone either scan the QR code below or click on it from within your phone&#8217;s browser. Alternatively you can simply search for <i>&#8220;Libre Droid&#8221;</i> in the Android Market.</p>
<p><center><a href='market://search?q=pname:fm.libre.droid'><img src='http://mikeasoft.com/~mike/libredroid-marketplace.png' alt='QR code for Libre Droid' /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2010/10/16/libre-droid-1-4-released/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Local map rendering and route finding with libchamplain, Spatialite and Open Street Map</title>
		<link>http://blog.mikeasoft.com/2010/09/24/local-map-rendering-and-route-finding-with-libchamplain-spatialite-and-open-street-map/</link>
		<comments>http://blog.mikeasoft.com/2010/09/24/local-map-rendering-and-route-finding-with-libchamplain-spatialite-and-open-street-map/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 15:07:03 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[champlain]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[n900]]></category>
		<category><![CDATA[openstreetmap]]></category>
		<category><![CDATA[osm]]></category>
		<category><![CDATA[spatialite]]></category>

		<guid isPermaLink="false">http://blog.mikeasoft.com/?p=182</guid>
		<description><![CDATA[This tutorial takes you through the steps necessary to build a simple application which is capable of displaying data from OpenStreetMap and find driving routes between two locations without the need for any network services. The final application will look something like this: And can even be used on the Nokia N900 mobile phone (running [...]]]></description>
			<content:encoded><![CDATA[<p> This tutorial takes you through the steps necessary to build a simple application which is capable of displaying data from OpenStreetMap and find driving routes between two locations without the need for any network services.</p>
<p>The final application will look something like this:</p>
<p> <center><img src='http://junk.mikeasoft.com/champlain-routing/local-rendering.png' alt='Final application demonstrating local render and routing' title='Final application demonstrating local rendering and routing' /></center></p>
<p>And can even be used on the Nokia N900 mobile phone (running Maemo):</p>
<p> <center><img src='http://junk.mikeasoft.com/champlain-routing/n900-map.png' alt='Local map rendering and routing on the Nokia n900 mobile phone' title='Local map rendering and routing on the Nokia n900 mobile phone' /></center></p>
<h4>Preparation</h4>
<p> The libraries you&#8217;ll need to install for this are:</p>
<ul>
<li><a href='https://trac.openstreetmap.ch/trac/memphis/'>Memphis</a> &#8211; A map renderer. Version 0.2.1 or later.</li>
<li><a href='http://projects.gnome.org/libchamplain/'>libchamplain</a> &#8211; Provides clutter based mapping widgets. You&#8217;ll need version 0.7.1 or later for memphis support, when compiling add <i>&#8211;enable-memphis</i> to the <i>./configure</i> parameters.</li>
<li><a href='http://www.gaia-gis.it/spatialite/'>Spatialite</a> &#8211; Provides OpenGIS compatible routing (and more) on top of SQLite. This needs to be version 2.4rc3 or later. You&#8217;ll also need the spatialite-tools package for importing <abbr title='OpenStreetMap'>OSM</abbr> data</li>
</ul>
<p> Next we&#8217;ll need to acquire some OSM data to work with, for this example we&#8217;ll be using a small area around Nantwich in the UK, which can be download <a href="http://junk.mikeasoft.com/champlain-routing/nantwich.osm">here</a>. Data for entire countries can be downloaded from <a href='http://download.cloudmade.com'>CloudMade</a>, or data from a smaller specific area can be obtained from the <a href='http://wiki.openstreetmap.org/wiki/Downloading_data#API_map_request'>OpenStreetMap API</a>.  </p>
<h4>Displaying the map</h4>
<pre style='overflow: auto;'>
#include &lt;gtk/gtk.h&gt;
#include &lt;champlain/champlain.h&gt;
#include &lt;champlain/champlain-memphis-renderer.h&gt;
#include &lt;champlain-gtk/champlain-gtk.h&gt;
#include &lt;clutter-gtk/clutter-gtk.h&gt;

#define MAP "nantwich.osm"
#define RULES "default-rules.xml"

static GtkWidget *window;
static ChamplainMapSource *tile_source = NULL;
static ChamplainMemoryCache *memory_cache = NULL;
static ChamplainView *champlain_view;

static void on_destroy(GtkWidget *widget, gpointer data) {
        gtk_main_quit();
}

static void zoom_to_map_data(ChamplainView *view) {
        ChamplainMemphisRenderer *renderer;
        ChamplainBoundingBox *bbox;
        gdouble lat, lon;

        <b><i>/* Fetch a reference to the memphis renderer */</i></b>
        renderer = CHAMPLAIN_MEMPHIS_RENDERER(
                       champlain_map_source_get_renderer(CHAMPLAIN_MAP_SOURCE(tile_source)));
        <b><i>/* Find what section of the world it covers */</i></b>
        g_object_get(G_OBJECT(renderer), "bounding-box", &amp;bbox, NULL);
        <b><i>/* Find the centre of that region */</i></b>
        champlain_bounding_box_get_center(bbox, &amp;lat, &amp;lon);

        <b><i>/* Zoom in on that position */</i></b>
        champlain_view_center_on(CHAMPLAIN_VIEW(view), lat, lon);
        champlain_view_set_zoom_level(CHAMPLAIN_VIEW(view), 14);
}

int main(int argc, char *argv[]) {
        GtkWidget *widget, *vbox, *bbox, *button, *viewport, *label;
        ChamplainMapSource *source;
        ChamplainRenderer *renderer;
        ChamplainMapSourceChain *source_chain;
        ChamplainMapSource *src;
        ChamplainRenderer *image_renderer;
        guint tile_size;

        <b><i>/* Initialize libraries */</i></b>
        g_thread_init(NULL);
        gtk_clutter_init(&amp;argc, &amp;argv);

        <b><i>/* Create a GTK window */</i></b>
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(window), "Local rendering and routing tutorial");
        g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(on_destroy), NULL);

        <b><i>/* Create an embedded champlain GTK widget */</i></b>
        widget = gtk_champlain_embed_new();
        <b><i>/* Get the ChamplainView contained within the GTK widget */</i></b>
        champlain_view = gtk_champlain_embed_get_view(GTK_CHAMPLAIN_EMBED(widget));

        <b><i>/* Setup memphis as our tile source. Normally champlain would download tile images
         * from one of a number of online services, by using memphis we can render all
         * the tiles locally without the need for a network connection. */</i></b>
        ChamplainMapSourceFactory *factory = champlain_map_source_factory_dup_default();
        source = champlain_map_source_factory_create(factory, "memphis-local");
        renderer = champlain_map_source_get_renderer(CHAMPLAIN_MAP_SOURCE(source));
        champlain_memphis_renderer_load_rules(CHAMPLAIN_MEMPHIS_RENDERER(renderer), RULES);
        champlain_file_tile_source_load_map_data(CHAMPLAIN_FILE_TILE_SOURCE(source), MAP);
        tile_source = CHAMPLAIN_MAP_SOURCE(source);
        source_chain = champlain_map_source_chain_new();
        tile_size = champlain_map_source_get_tile_size(tile_source);
        src = champlain_map_source_factory_create_error_source(factory, tile_size);
        champlain_map_source_chain_push(source_chain, src);
        champlain_map_source_chain_push(source_chain, tile_source);

        <b><i>/* Use a memory cache so that tiles don't have to be re-rendered everytime they're
         * displayed. Another option would be to use a file cache allowing the tiles to be
         * saved across multiple runs of the program (but at the expense of disk space). */</i></b>
        image_renderer = CHAMPLAIN_RENDERER(champlain_image_renderer_new());
        <b><i>/* We store up to 200 tiles in the cache */</i></b>
        memory_cache = champlain_memory_cache_new_full(200, image_renderer);
        champlain_map_source_chain_push(source_chain, CHAMPLAIN_MAP_SOURCE(memory_cache));
        g_object_set(G_OBJECT(champlain_view), "map-source", source_chain, NULL);

        <b><i>/* Request a minimum size of 400x300 */</i></b>
        gtk_widget_set_size_request(widget, 400, 300);

        <b><i>/* Add our embedded champlain widget to the window */</i></b>
        gtk_container_add(GTK_CONTAINER(window), widget);

        <b><i>/* Display the window */</i></b>
        gtk_widget_show_all(window);

        <b><i>/* Find our OSM data on the map and show it */</i></b>
        zoom_to_map_data(champlain_view);

        <b><i>/* Start the GTK main loop */</i></b>
        gtk_main();

        return 0;
}
</pre>
<p>    To compile this example (assuming you&#8217;ve saved it to <i>&#8216;champlain-routing.c&#8217;</i>) run:</p>
<p>     <tt>gcc `pkg-config --cflags --libs spatialite champlain-0.8 champlain-gtk-0.8 champlain-memphis-0.8` champlain-routing.c -o champlain-routing</tt></p>
<p>    This is a fairly standard champlain program except it uses the memphis renderer to create tile images locally instead of fetching them from an online tile server. In addition to <a href='http://junk.mikeasoft.com/champlain-routing/nantwich.osm'>nantwich.osm</a> you&#8217;ll also need <a href='http://junk.mikeasoft.com/champlain-routing/default-rules.xml'>default-rules.xml</a>, which defines the appearance of the map.</p>
<p>    The resulting program will give us a small window that displays our map data without the need for an internet connection:</p>
<p> <center><img src='http://junk.mikeasoft.com/champlain-routing/step-1.png' alt='Displaying the map via libchamplain' /></center></p>
<h4>Creating routing data</h4>
<p>    Before we can performing any routing tasks we first need to import our OSM data into spatialite and create a routing network from it.</p>
<h5>Importing OSM data into spatialite</h5>
<p>      <tt>spatialite_osm -o nantwich.osm -d nantwich.sqlite -T roads -m</tt></p>
<h5>Generating a routing table</h5>
<p>      <tt>spatialite_network -d nantwich.sqlite -T roads -g geometry -c cost -t node_to -f node_from -n name --oneway-fromto oneway_fromto --oneway-tofrom oneway_tofrom -o roads_net_data</p>
<p>            spatialite nantwich.sqlite 'CREATE VIRTUAL TABLE "roads_net" USING VirtualNetwork("roads_net_data")'</tt>.</p>
<h5>Automatic import</h5>
<p>     I&#8217;ve joined these stages together into a small script, available here: <a href='http://junk.mikeasoft.com/champlain-routing/populate_spatialite.sh'>populate_spatialite.sh</a>. It takes two parameters, the first being the OSM data to import and the second is the spatialite database to be created:</p>
<p>    <tt>./populate_spatialite.sh nantwich.osm nantwich.sqlite</tt></p>
<h4>Finding and drawing a route</h4>
<p>   First we define a couple of new global variables for storing references to our route&#8217;s polygon, our Spatialite database, and our database&#8217;s filename:</p>
<pre style='overflow: auto;'>
#define SPATIAL "nantwich.sqlite"

ChamplainPolygon *route_polygon;
sqlite3 *handle;
</pre>
<p>   Then we initialize Spatialite within our main setup:</p>
<pre style='overflow: auto;'>
int main(int argc, char *argv[]) {
        <i>...</i>
        g_thread_init(NULL);
        gtk_clutter_init(&amp;argc, &amp;argv);
        spatialite_init(0);
        sqlite3_open_v2(SPATIAL, &amp;handle, SQLITE_OPEN_READONLY, NULL);
        <i>...</i>
}
</pre>
<p>   Finally we can create a function for drawing the routes between two OSM nodes:</p>
<pre style='overflow: auto;'>
<b><i>/* Takes two OSM node IDs representing the desired
 * start and end locations and draws the route between
 * them on the map. */</i></b>
static void draw_route(int from, int to) {
        ClutterColor color = { 0x00, 0x11, 0x33, 0x99 };
        int ret, n_rows, n_columns, i, points;
        float lat, lon;
        char sql[256];
        char **results;
        char *err_msg = NULL;

        <b><i>/* Remove any previously displayed route */</i></b>
        if(route_polygon != NULL) {
                champlain_view_remove_polygon(champlain_view, route_polygon);
        }

        <b><i>/* Find out how many points there are in the route */</i></b>
        sprintf(sql, "SELECT NumPoints(Geometry) FROM Roads_net "
           "WHERE nodeFrom = %d AND nodeTo = %d LIMIT 1", from, to);
        ret = sqlite3_get_table(handle, sql, &amp;results, &amp;n_rows, &amp;n_columns, &amp;err_msg);
        if(ret != SQLITE_OK) {
                printf("SQL error: %s\n", err_msg);
                sqlite3_free(err_msg);
                return;
        }

        <b><i>/* Check to see if we could find a route */</i></b>
        if (n_rows == 0 || results[1] == 0) {
                printf("No route for %d -> %d\n", from, to);
                return;
        }

        points = atoi(results[1]);

        <b><i>/* Create a new champlain polygon */</i></b>
        route_polygon = champlain_polygon_new();

        <b><i>/* Add each point in the route to the polygon */</i></b>
        for (i = 1; i &lt; = points; i++) {
                sprintf(sql, "SELECT X(PointN(Geometry, %d)), Y(PointN(Geometry, %d)) "
                   "FROM Roads_net WHERE nodeFrom = %d and nodeTo = %d LIMIT 1", i, i, from, to);
                ret = sqlite3_get_table(handle, sql, &amp;results, &amp;n_rows, &amp;n_columns, &amp;err_msg);
                if(ret != SQLITE_OK) {
                        printf("SQL error: %s\n", err_msg);
                        sqlite3_free(err_msg);
                        return;
                }
                sscanf(results[2], "%f", &amp;lon);
                sscanf(results[3], "%f", &amp;lat);
                champlain_polygon_append_point(route_polygon, lat, lon);
        }

        <b><i>/* Set the polygon's display properties */</i></b>
        champlain_polygon_set_stroke_color(route_polygon, &amp;color);
        champlain_polygon_set_stroke_width(route_polygon, 12.0);

        <b><i>/* Show the polygon on the map */</i></b>
        champlain_view_add_polygon(champlain_view, route_polygon);
}
</pre>
<p>    To see what this does we can then try calling draw_route towards the end of our main function:</p>
<pre style='overflow: auto;'>
int main(int argc, char *argv[]) {
        <i>...</i>
        <b><i>/* Find our OSM data on the map and show it */</i></b>
        zoom_to_map_data(champlain_view);

        <b><i>/* Draw an example route */</i></b>
        draw_route(291898931, 263396519);

        <b><i>/* Start the GTK main loop */</i></b>
        gtk_main();
        <i>...</i>
}
</pre>
<p>    The main part of this likely to need further explanation are the SQL queries being used. To find a route between locations a query can be performed on the Roads_Net virtual table, to see the sort of results this generates we can load the database into spatialite directly and try some queries.</p>
<p><tt>spatialite nantwich.sqlite</tt></p>
<p>    This starts an sqlite session with the spatialite extensions already loaded, so we can just type out our query directly and see the results:</p>
<p><tt>spatialite> <b>SELECT * FROM Roads_Net WHERE NodeFrom = 291898931 AND NodeTo = 263694833;</b></p>
<table>
<tr>
<th>Algorithm</th>
<th>ArcRowid</th>
<th>NodeFrom</th>
<th>NodeTo</th>
<th>Cost</th>
<th>Geometry</th>
<th>Name</th>
</tr>
<tr>
<td>Dijkstra</td>
<td></td>
<td>291898931</td>
<td>263694833</td>
<td>44.5477589762393</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Dijkstra</td>
<td>625</td>
<td>291898931</td>
<td>30091396</td>
<td>9.26106988426742</td>
<td></td>
<td>Hawksey Drive</td>
</tr>
<tr>
<td>Dijkstra</td>
<td>863</td>
<td>30091396</td>
<td>291797647</td>
<td>8.05233487984465</td>
<td></td>
<td>Peter Destapleigh Way</td>
</tr>
<tr>
<td>Dijkstra</td>
<td>864</td>
<td>291797647</td>
<td>30091398</td>
<td>2.10526089940676</td>
<td></td>
<td>Peter Destapleigh Way</td>
</tr>
<tr>
<td>Dijkstra</td>
<td>865</td>
<td>30091398</td>
<td>30091397</td>
<td>2.57141142336182</td>
<td></td>
<td>Peter Destapleigh Way</td>
</tr>
<tr>
<td>Dijkstra</td>
<td>1100</td>
<td>30091397</td>
<td>30091385</td>
<td>10.1017580189628</td>
<td></td>
<td>Audlem Road</td>
</tr>
<tr>
<td>Dijkstra</td>
<td>1101</td>
<td>30091385</td>
<td>291797619</td>
<td>1.21093075722029</td>
<td></td>
<td>Audlem Road</td>
</tr>
<tr>
<td>Dijkstra</td>
<td>1102</td>
<td>291797619</td>
<td>30091384</td>
<td>2.78122691192808</td>
<td></td>
<td>Audlem Road</td>
</tr>
<tr>
<td>Dijkstra</td>
<td>1994</td>
<td>30091384</td>
<td>263694833</td>
<td>8.46376620124748</td>
<td></td>
<td>Wellington Road</td>
</tr>
</table>
<p></tt></p>
<p> The first row gives us details about the entire route, each following row is a single step along that route including the name of the road we&#8217;re travelling on at the time. You&#8217;ll notice that the Geometry column appears to be empty, this column is actually accessed through a number of different functions, to get a plain text representation of the geometry for our route we can do:</p>
<p><tt>spatialite> <b>SELECT AsText(Geometry) FROM Roads_Net WHERE NodeFrom = 291898931 AND NodeTo = 263694833 LIMIT 1;</b><br />
LINESTRING(-2.509696 53.058716, -2.509586 53.058025, -2.512386 53.057934, -2.512593 53.05792, -2.513372 53.057853, -2.514185 53.057543, -2.514511 53.057525, -2.515953 53.057457, -2.51673 53.057505, -2.517495 53.058079, -2.517746 53.058306, -2.518433 53.058776, -2.519147 53.059387, -2.519725 53.06049)</tt></p>
<p> Or to get the X, Y position for a single point along that line we can use the X(), Y() and PointN() functions as we do in our draw_route function. So to find the position of the 4th point we could do:</p>
<p><tt>spatialite> <b>SELECT X(PointN(Geometry, 4)), Y(PointN(Geometry, 4)) FROM Roads_Net WHERE NodeFrom = 291898931 AND NodeTo = 263694833 LIMIT 1;</b><br />
-2.5125926|53.0579196<br />
</tt></p>
<p> From here the program could be easily extended to look up OSM IDs based on their street names (stored in the roads table), to find the nearest OSM ID to a GPS position or to display text based driving instructions, all with just a few SQL queries.</p>
<h4>Complete listings</h4>
<p>   The full source code and data for this tutorial can be downloaded here: <a href='http://junk.mikeasoft.com/champlain-routing/champlain-routing.tar.gz'>champlain-routing.tar.gz</a>. The complete program includes some additional enhancements such as the ability to request routes based on street names (in a simple, but non-robust manner) and zoom level controls.</p>
<p>   If you create anything based on this tutorial I&#8217;d be very interested to hear about it <img src='http://blog.mikeasoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikeasoft.com/2010/09/24/local-map-rendering-and-route-finding-with-libchamplain-spatialite-and-open-street-map/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

