Monday, October 29, 2012

Openstreetmap Zoom

I have played around with this before. Having recently set up Mapnik again to render Openstreetmap data. Currently it is using the standard Openstreetmap osm.xml file so should look like the mad used on the main website.

This animation is created by rendering each frame with Mapnik. The script is based on a hack of the standard generate_image.py script that comes with Mapnik. It simply loops, and for each loop a new bounds is calculated to provide the zoom effect.

A seperate script is used that adds the watermarks in the bottom corners of each frame. This was done with the help of ImageMagick. Finally, avconv was used to convert the frames into an mp4 file.

The next step is to make an animation based on a GPX file. That will take a GPX file as input and provide a zooming animation that shows the start, and an overview of the whole GPX track.

Wednesday, October 10, 2012

Garmin Vista HCx

Some time ago, I purchased a Garmin etrex Vista HCx. Certainly not the most sophisticated GPS system available, but still good fun. It works well in the car, the pocket and on the bike. The only real downside was that the maps that come with it are fairly limited, and it would work out expensive to purchase all the maps I may want to use with it.

That said, it still works very well for recording tracks. When I first had the device, Openstreetmap was still fairly incomplete in my area, so it was good fun uploading GPX traces to help add detail to the map.

Eventually, I found out how to create a map from the Openstreetmap data that can be loaded into the Garmin etrex Vista HCX device. It requires a number of steps, but these are easy in Linux.

Grab the data

The data that is used to build the Openstreetmap map is freely available. There are a number sources for the data, but it would not be normal to want the entire world database. The people at Geofabrik provide a usefull service where they maintain a selection of extracts. Please remember this is provided as a service, so be kind to their servers. The extract I get is the one for Great Britain.

wget http://download.geofabrik.de/openstreetmap/europe/great_britain.osm.pbf

Get the tools

A number of tools are required to process the data to make it useful for the Garmin. Following is a list of tools that I have found work for me.

Splitter
Used to split the map into manageable pieces.
Mkgmap
Converts the OSM data into format suitable for Garmin device

Use the tools

These tools can be used as follows. This is not a definitive guide. Best refer to the relevant sites for the tools, but this is how I am using the commands.

splitter

java -Xmx1536m -jar splitter.jar \
   --max-nodes=1000000 \
   --mapid=63240001 \
   great_britain.osm.pbf

This will generate a series of files from the input.

mkgmap

CMD="java -Xmx1024m -jar mkgmap.jar \
   --route --remove-short-arcs \
   --add-pois-to-areas --index \
   --location-autofill=bounds \
   --generate-sea"
for f in 6324*.osm.pbf
do
    echo $f
    $CMD $f
done

After this is run, we should have a number of .img files. At this point, it may be possible to use these tiles with the Garmin map tool for the PC. But why bother. Let us just bundle these all up into one large file.

java -Xmx1024m -jar mkgmap.jar \
   --gmapsupp --family-id=50 --product-id=1 63*.img

This should result in a single map file named gmapsupp.img. All we need to do now is copy this to the Garmin directory on the SD card used by the Etrex Vista HCx.

Results

Thursday, August 09, 2012

Windows 7 use NTP when in domain

Having recently had to reload windows, one of the little things to irritate me was the clock being wrong. It would seem logical that any computer with a reliable web connection should have the correct time. Well the default situation for Windows 7, when in a domain is to not allow the user to select a NTP server to sync with. Sensibly, it will sync with the domain controller.

Unfortunately our domain controller does not have the correct time. So my clock was wrong, and there was no 'point and click' way to fix it.

After some searching around a solution was found.

  • Click 'Start' and type cmd in the search box
  • Right click cmd.exe in the results, and select 'Run as administrator'
  • At the command prompt, run the following:


c:\>w32tm /config /update /manualpeerlist:"uk.pool.ntp.org" /syncfromflags:manual
c:\>net stop w32time
c:\>net start w32time

It would be good to change the URL in the first command to a suitable pool from this list based on your location.

Wednesday, August 01, 2012

Windows 8 Preview

The hard drive failed on my computer. Just went phut! No warning or anything. So that required a new hard disk. With a new blank disk in the machine, it seemed like an ideal opportunity to give Windows 8  preview a spin, before putting the system back.
The install was painless. Probably as it is not released yet, there was not the endless list of updates required with an older version of Windows.
The first impression is it feels a little mixed up. The new Metro interface looks clean and works well, but feels out of place on a desktop machine with a large monitor. If the screen was touch enabled, or it was a tablet, then great, but on a desktop, not so sure. Behind that, there is the more familiar windows interface, but without a Start button. This feels more natural for a desktop, but again, elements from the Metro interface pop up when the mouse hits a corner.
Maybe it still needs some polish, and the final release version will be more coherent. One thing is for sure, it will get noticed. Some are going to love it, but there will be lots of noise from those that hate it.
The big thing that struck me was how it compares with my recent experience with Linux. For some time now I have been using Ubuntu. The Unity interface for Ubuntu at first felt like a simplified interface for small screens. Once familiar with it, it works very well, but in a different way to the sort of desktops we are used to. With Windows 8, it feels like they are hedging their bets, and using two styles of interface.
Whatever the design goal is, and the direction it takes, it does feel like Windows is now following Linux. That was the weirdest thing about my experience of the Windows 8 preview.

Wednesday, May 30, 2012

Alternative Window Managers


For sometime I have been using Ubuntu, and been very happy with it. More recently I have started to be less satisfied. Not sure why. Since upgrading to 12.04 things have not been so good. It is probably about time that the machine was installed fresh as that last happened at 10.04.

Before doing something that drastic, I decided to have a look at some alternative Window Managers. This is what I found.

Sunday, May 20, 2012

New Cycle Bag - Carradice SQR Tour


Finally got fed up with using a back pack on the bike. My old bike had panniers, but I did not want to fit them to my current bike, so have been using a back pack. Although it was a good bag, it meant that my back was always hot and, err, sticky!

So I looked around for an alternative, and this is what I found. It is from a company called Carradice. This model is the SQR Tour. It is of solid construction. It is easy to fit to the bike and can hold sixteen litres of my junk.

A couple of advantages are that I can put tools and spare tubes in the side pockets so that I don't have to rummage through my clean clothes to find them when required. It also includes a plastic strip to act as a mud guard. Finally, there is a mounting position for the rear light on the bag. Next winter, when I get to work, I will only have to collect the front light from the bike when I lock it up. Small point, but they all add up.

After one week, I am really happy. Lets hope it holds up!

Thursday, May 10, 2012

Broken Seat Clamp

Image of broken seat clamp

The very first day I rode my bike to work, the seat post was slowly sliding down into the frame. A few weeks back I had to adjust it up again. Some would suggest that the bike is trying to tell me to loose some weight. Again, the seat was too low. 

So, this evening, I went out to put it up again ready for the morning. So I tightened it up. Then a bit more, Well then just a bit ... ping!!! Nuts.

What to do? First a quick check of the old bike. That was too small. Next I called my brother to see if he had a spare. Same problem. This bike has a seat tube of 34.9mm. It was getting late, and there was only one thing for it. A quick dash to the local Halfords and I managed to pick up a spare.

Image of new seat clamp
We are back on the road.




Tuesday, May 08, 2012

Portable Apps

Portable Apps Logo
While at work I wanted to have access to the applications I am familiar with on Linux available on my Windows machine. For some time, that was achieved by running Ubuntu in  VirtualBox.

This does work great with only the slight issue of getting access to my networked drives.
Thinking I may be over complicating matters, I started to look at the native Windows versions of the programs that were most useful to me from Ubuntu. These were Gimp and Inkscape. The CAD package that is the base of most of my work does occasionally fall over. So to help reduce that, it is not ideal to load lots of applications.

Somewhere along the way I found a nice tidy solution with Portable Apps.
These are intended to be loaded onto a USB stick and run without doing a full install. Well there is no reason why they can't also be installed onto the hard drive.
This gives the following benefits:-

  • I now have easy access to lots of native applications.
  • They don't need to be 'installed'.
  • All updates are from one place.
  • The latest 2.8 version of Gimp.
The VirtualBox solution will remain, but day-to-day work will be with the Portable Apps.

Tuesday, May 01, 2012

New Blog

OK, this is a first post. I have used Wordpress for my blog, but now I no linger desire to keep my own machine running all the time. So from here on in, I will try and use this blog, hosted by Google.