introducing cblocation for ios devices

Thu, Feb 3, 2011

I’ve started working on a spare time app for the iPhone that lets you find out about the geology in the vicinity of the device. The first version will just tell you what sort of rock you’re standing on. I’m asked this question quite a lot when I’m guiding in the mountains so I thought it would be a fun learning exercise for iOS development and to get an app in the App Store.

The first thing I needed to do is somehow convert the Core Location latitude/longitude to OS Grid coordinates. This is a horrendous job, with horrendous maths but luckily I stumbled on Chris Veness’s javascript pages, which do just that. Chris has kindly open sourced the code so I took the liberty of porting it to Objective-C. It’s now available under the MPL 1.1 license on my GitHub repo:

CBLocation

The current version converts latitude/longitude to OS grid coordinates but I’m sure I’ll port more of Chris’s code as and when I need it, as well as write some additional functionality.

comments powered by Disqus