Blog Image

CodeBlog

Coding

Creating code, mostly for the fun of seeing it work.

Downloads

OSM Posted on Thu, September 25, 2008 22:18:12

I decided that I’d make some of my examples available as a download. It may be interesting for someone, and it makes a backup for me. I’ve just cobbled together a flat html site to display pull this together, but I will need to replace it with something a bit more manageable.

I’ve moved my domain to ONE.COM who host a site with 3gb, a MySQl db and unlimited email accounts for very little money – I guess you found it because you’re reading this blog, but the URI is www.cjhill.co.uk . I think I’ll create a little database and PHP app to display the list of files to download, but not just yet.



Starting out

OSM Posted on Thu, September 25, 2008 12:32:13

I’ve been working on some code on and off for a few of weeks, but not with a blog to match. Rather than go through the whole stuff to date, I’ll fill in the gaps as need be.

My background did not include Linux, but Open Street Map (OSM) is Linux orientated and especially open-source software. On a PC I would turn to Delphi or C# on Dot Net to create a program and I have experimented with such code, but it is largely spurned by the OSM community. Much of the coding for client PCs is in Perl – it works across different platforms but it doesn’t float my boat. So I set out to reacquaint myself with C++.

I have a machine with Ubuntu 8.04 on it. I’m still learning more about Ubuntu, and I’m steadily becoming more confident and content with it. I installed g++ and created a few examples to get going again. It feels a bit clunky using a command line and it feels really hard work without code completion in an IDE, but I decided that I wanted to work from the ground up to be sure I understand.

OSM data is accessed from the server by HTTP and arrives as XML. The standard c++ libraries don’t cover this, so I looked around for how other people do it. The Poco libraries stood out as covering a wide range of useful additional libraries. They are open-source so people should be fairly happy. smiley

I have used the Poco XML SAX library to extract the OSM data into custom, simple objects. I’m fairly happy with this, it runs very quickly, the memory management is simple, but the documentation took me a few hours of head scratching to understand how to use the classes. I’m still not sure that I have used SAX the way it is intended. I used the Poco HTTP classes to access data from the API server and it worked first time.

Now I want to do some tile handling …