As a follow up to my previous post about using Google Maps in conjunction with your own GPS data, you can also do the same thing in Google Earth. Something I missed before was that the same GPSVisualizer site provides the service so that you upload your GPS file, and it generates a Google KMZ file for you. Click on it, and the file gets downloaded and launched in Google Earth directly. Very neat and very easy. Here’s a screenshot:
[Read more →]
Plotting your GPS tracks in Google Earth
June 26th, 2007 · GPS, Google Earth/Maps
→ No CommentsTags:
Playtime with Google Maps and GPS
June 26th, 2007 · GPS, Google Earth/Maps
I’ve been dabbling with Google Maps recently as I want to download some GPS data from my PDA to visualise and analyse journeys that I have made. I also think Google Maps and its 3D sibling Google Earth are the absolute dogs doodads of applications and so any excuse to play with these was welcome.
I started with a .GPS file that was generated automatically by Copilot, which is the in-car satellite navigation software that I use. It’s pretty good, but like all Satnav systems you need to be aware of its foibles to get the best out of it. Never, ever, simply follow the instructions!
The GPS track was a record of my travels on Monday 25th June as I tried to get into work in Sheffield as it was getting hit by freak floods. Getting in was OK(ish), but took a long time. Getting home again was a bit more interesting as I kept trying to avoid all the bad traffic.
Anyway, since I was being forced to turn around and try new routes to avoid flooded roads, jams etc, I wanted to see on my PC where I had been. What I did not know was a quick and easy way to do it.
Copilot has a PC hosted planning application, but that won’t take the GPS tracks that the PDA version generates (sigh….). Ideally I wanted to put the tracks into Google Earth to look at in glorious 3D, but I currently only have the free version that does not allow GPS tracks to be imported.
A quick webhunt brought up GPS Visualizer. This provides a free service that allows me to upload the GPS file, and it generates a Google Map with a vector overlay of the results. Even better, the site contains instructions on hosting the resulting map on your own website.
So I had a go at this. The HTML pathway was a huge faff, to be honest, as I was rather foolishly trying to use Frontpage. The problem was that it was trying to be too smart on the Cut and Paste operation, which screwed HTML tags over. In the end, a quick path was to:
- View GPS Visualizer page source
- Save source to local HTML file on disk
- Open HTML with an editor. Even Frontpage could manage this bit!
- Locate the Google API key, and replace it with my own (see below).
- Set page titles, modify the default 600×600 window
- Upload to my website
The resulting page can be seen here.
If you want to do this yourself you’ll need a Google API key, which you can get from here
→ No CommentsTags:
Masters thesis submitted at last!
May 7th, 2007 · Life
Phew! After an eventful last seven years, I finally managed to get my Masters thesis submitted this week. The title? Wait for it…..
The use of 2D views to aid interaction and visualisation within 3D Collaborative Virtual Environments
When I started it I was a partner in a new tech startup called RealiMation Ltd, and doing a research degree into some aspect of collaborative virtual reality was a natural extension to my work. But shortly after I started, RealiMation was acquired by Criterion Software, and a few years later by Electronic Arts, which in combination provided a radical - yet enjoyable - change in life. But I persevered, and finally manage to submit my thesis seven years after I started. Apparently this is not the record, however, which was somewhat disappointing!
At the time of writing I have no idea if I have passed, but that’s almost beside the point. I could so easily have given up, but stuck at it and produced a decent piece of work in the end.
Just for interest, here’s the abstract:
[Read more →]
→ No CommentsTags:
Thoughts on a ‘Powerful’ API
April 18th, 2007 · Software Development
One of the words that keeps coming up when I have conversations about new products is that the API must be “powerful”. While intuitively this sounds good - after all, who wants to develop an API that is a bit wimpy - how can you measure and judge the power of one API over another? I’m pretty sure that you can’t assign a wattage to a function call.
[Read more →]
→ No CommentsTags:
Tips for returning IDENTITY values from INSERT
January 14th, 2007 · ASP2, SQL
There’s a good article by Scott Guthrie here that describes the basics. Just scroll down to Tutorial 5 for the INSERT specific bit - it is pretty straightforward and there is no point my repeating it here.
One point to note, however, and why I wrote this particular post. The key step in getting this working is changing the query type from NonQuery to Scalar. But this can get reset by Visual Studio if you choose the Configure option on the ObjectDataSource’s smart tags to modify the query in any way. If you don’t notice this, then suddenly the identity value stops getting returned and your code breaks.
The second tip is that by default the type returned by the insert query is decimal. This can cause some extra casting in your code if you were expecting it to be int. To fix this, just modify the SQL in Scott’s original article to be this:
SELECT CAST (SCOPE_IDENTITY() AS int)
→ No CommentsTags:
Determining row counts for all tables in a database
January 11th, 2007 · ASP2, SQL
Here is a usful snippet if you want a way to get the number of rows in each table in your database. I use this in an admin-only page of the web application to provide some at-a-glance statistics. It is also really useful in unit tests for checking the correctness of business logic that may create new entries in several tables in one transaction.
→ No CommentsTags:
Formatting code in Wordpress
January 11th, 2007 · Blogging
What a pain in the rear! Wordpress appears nice as a blogging tool, but my attempts to format some code snippets was painful beyond belief.
Every time I pasted some code in and surrounded it with the code tags, the generated HTML had extra paragraph markers and line breaks, and screwed up the position of the closing code marker.
Even a search for plugins did not cure things. I installed one or two “code formatting” plugins that made things a little better, but still required a lot of post-paste editing of code to get anything like presentable.
It turns out that the Rich Text Editor in Wordpress 2 is to blame - it completely messes up. So my advice is to disable this from your user profile.
The thing that rankles is that the rich editor is enabled by default. I did not even know it was optional until I did a Google on code formatting in Wordpress. It all just seemed much much harder than it should.
Anyway, hopefully this snippet will save others the problem in the future.
→ No CommentsTags:
Useful CSV reader
January 10th, 2007 · .net, Software Development
To aid my unit testing I needed to populate a database with a load of test data. This data needs to be generated by some of the less technical guys on the project and so exporting CSV (Comma Separated Values) files from Excel seemed a sensible approach. So I then cast around for any existing code that would save me having to write a robust CSV parser. The search turned up this on CodeProject:
The neat thing about it is that you can get field values either by index position or column name, assuming you put column headers in your file. The column name feature really helps out with maintainance of the test data as we evolve and vary the schema slightly - we can insert columns with no worries about upsetting existing reader code.
It’s easy to use and install in your own project, and the CodeProject article describes the basic usage pattern. At the moment it is just linked in to the unit test framework, but is so useful I will probably make it a part of the core application libary to facilitate importing data from customers as we anticipate some of our customers could have thousands of records to import when they move to our system.
→ No CommentsTags:
Don’t believe NUnit!
January 5th, 2007 · ASP2
Just a quick note about a little problem I found using Nunit (2.2.9, but affects earlier revisions too).
After a bunch of edits to my project, I suddenly started getting messages from NUnit GUI “could not load file or assembly nunit.core”. Try as I could, this would not go away. This included everything from reinstalling NUnit to tracking DLL loading via SysInternal’s Process Explorer tool.
My project is non trivial - a top level solution containing an ASP2 web project, a couple of library DLL’s for the business logic, a unit test exe, and a testing helper library to help cross reference test results against direct SQL calls. As I’ll be writing about in another post shortly, incorporating unit testing into an ASP project is a pain in the rear and so I had been restructuring things. My natural assumption based on the error message was I had messed up something in the linking/referencing.
But it turned out to be an error in the application config file - for some reason NUnit reports this as a DLL missing, not that you have mistyped a bit of config text. I simply had a closing tag in the wrong place - still syntactically correct, however.
This link is by someone else who hit the exact same problem, and he has written about in more detail.
So remember folks: never assume a programmer - even those as good as the NUnit guys - generate the correct error message for all circumstances.
→ No CommentsTags:
Perforce server logging problem
January 2nd, 2007 · Perforce, Software Development
When setting up a server it is often useful to enable one of the logging levels. The admin guide states that you need to do this:
- p4 set P4DEBUG=server=2
which sets the server logging level to 2. You then need to restart the Perforce server.
However, if Perforce is running as a service (the default under Windows), then this does not work. The reason is that “p4 set” only sets the variable in for HKEY_CURRENT_USER in the Windows registry. However, when running as a service, p4d picks up its environment variables from HKEY_LOCAL_MACHINE. To do this you need to set the ‘-s’ flag. E.g.
- p4 set -s P4DEBUG=server=2
→ No CommentsTags:



