Saturday, October 20, 2018

Oh no! He’s at it again

In my relentless quest for displacement activities, I’ve been back at the coding keyboard.  I know, I can’t help it. This time putting together a phone / tablet  App that tells me where I am (as if I didn’t already know!).  Actually it does a bit more than that.  Here, take a look.

Assume I am chugging along the canal, maybe seemingly in the middle of nowhere.  Whipping out my trusty phone and opening this this app ‘wot I have writ’ (no internet or phone connection required), I see a screen like this.

RESULT1

The phone uses its location ability to get the latitude and longitude and it looks that up in my file of places along the canal, so I get some idea of where we are and how far etc it  is to the next five upcoming places we may like to stop.   I tested the “find me” bit last time out and much to my surprise it works!  The GPS seems to be accurate to within three metres or so most of the time.

See the button marked feature search?  I tap that and  get this list from which I can pick any feature I may wish to find “down the road”

FEATURELIST

It might be the next lock or the next pub etc.  This time I tap Water (sorry for the unintended pun there) and up comes this:

WATERLIST

Actually I tapped it once to get Thrupp, then the “further” button to see the next two.  It all works pretty instantaneously despite my probably inefficient coding style.  Cruising times are, as ever, only estimates and assume 2.7mph (which experience suggests is a good overall average on this canal) and ten minutes per lock,  The answer you get seems to be about right unless you get held up.

What does that tell me that Nicholson’s doesn’t, you may ask.  Well not a lot really although it does do the sums for you and it is pretty fast.  You may also ponder why I should bother as by now I know the South Oxford canal rather better than the back of my hand. Hmm, the only way I can answer that is to say I enjoyed the challenge of doing it. Imagine it as a fascinating logic puzzle.  I did have problems in a couple of places where the canal doubles back on itself.  Did you know, for instance,  that when travelling south past Enslow, the canal turns briefly North and also think of all that wiggling around up on the Wormleighton summit.  Up there it’s hard to know whether you’re coming or going half the time.   I had to think up a complicated bit of “ifs”, “ands” and “ors” to get round places like that.  That’s the fun of doing this stuff.

As you would expect, a lot of the canal data was extracted from Canalplan (thanks again Nick), but this time  I have added in my own data about water points, pubs etc as well as including some nice remote mooring spots not specifically identified in Canalplan (Kirtlington Quarry for example).  My idea is that eventually I’ll do versions for canals that I am not so familiar with, then of course I might find it a lot more useful.  Sadly I have no idea how to create this app for an iphone, this version is for Android only.  It can be installed as a standalone Android app, requiring no other software, so it can be transferred to any Android phone / tablet. Using it requires absolutely no keyboard input what ever, just tapping stuff already on screen, so even your granny could do it.    In the nature of things I can still think of ways to improve it and I still have to tidy up tiny things like what happens when you get to the end of the canal, or press a button at the wrong time, but I’m nearly there.  Actually, I have just this minute noticed that I haven’t added ‘Water’ at Heyford Bridge. See, there’s always something to fix.  Software is never finished. I don’t want to finish too soon or I’ll have to do some real jobs around the house/ garden/ boat.  Actually, inspired by Oakie I have started on a padded steerers seat for Herbie.  More of that later.

2 comments:

Oakie said...

Thanks for the plug Neil. Actually, one of the seats broke away after rotting through and I was without it for the Thames cruise back home. The seat is now at home waiting to be remade from thicker ply. Did you put a jinx on it when you were on board?

Vallypee said...

I am inordinately impressed, not that I would ever need an app like this. I don't even have a smartphone, but the fact that you can even do it is quite mind boggling!