An attempt to rescue some overly dark photos with the magic of software.
An attempt to rescue some overly dark photos with the magic of software.
I’ve been working my arse off the past few weeks on various projects for clients, and feel the need to write. I’m not sure what I want to write about so I just opened up WordPress and decided to experiment. This post is that experiment.
This morning (a Sunday morning – internationally recognised as me time), I’m taking time away from that for a couple of hours to do what I used to do before “playing on the computer” turned into “making a living”. I’m going to write this as I go, so it’ll probably be terrible. But meh, that’s not a good enough reason not to do it.
Prep coding fuel (actually from a few weeks ago, but representative of liquid requirements):
I’m going to make something with OS OpenSpace; Ordnance Survey’s Google Maps-alike API for using OS map imagery in a manner familiar to developers. You can read about it here.
It’s been on my list of rainy day play-around projects for ages, and whilst I keep getting emails about cool new stuff they’ve done with it, I never seem to have that spare time to actually try it out. This morning that changes. It sounds cool, I want to make something, so I am.
The first part of using any new API is getting something working. I normally do this by setting up an empty project in Android Studio, importing any required libraries and setting up the API keys, secrets tokens or whatever the API uses for authentication.
As I’ve signed up for an API key already, I went to the Manage My Sites page (which is for apps too, despite the “sites” title) on the OpenSpace site to see what my API key is, and to find out which package name I originally used when I signed up – I’ll need to use the same one for this mini-project. I called it com.mattfenlon.osmap, so that’ll be my package name.
Next bit is to integrate the Android SDK if they have one, which they do. Cool.
But bloody hell…not the most straightforward quick start guide I’ve ever seen! To save you skimming time if you want to just get the jar file, it’s here. Import it into Android Studio (or Eclipse if you’re a masochist and haven’t switched yet). Not covering that step here. GIYF.
By this point I’ve got the jar file set up as needed in my AS project, and it’s syncing fine. I’ve loaded up a Genymotion emulator (because the Android SDK emulators suck…); a Nexus 6 configuration, running Lollipop. Because shiny. The app builds and loads the bog “Hello World” with no errors, we’re in business.
Incidentally I’m using Fragments not Activities, because they’re efficient, super-flexible and best practice. Anyone who tells you otherwise is either too lazy to learn the new way, or is recycling old projects from the days that they used to use Activities and cba to update their base projects. Sorry, it’s my opinion of course, but there’s no downside to using Fragments for even simple projects like this if you’re a half-decent developer. /rant
From the example app, it looks like it needs Internet, External Write and Access Network State. Also Open GL ES 2, presumably for some map rendering shenanigans.
This is done in XML. Nothing fancy, just a <fragment> of name:
It has a label too, not sure if that’s needed yet.
Similar but not the same as a Google Maps setup. I’m using the demo app they provide in GitHub to get the map object instantiated. The only difference being that I’m doing this within a Fragment rather than an activity, so getFragmentManager() becomes getActivity.getFragmentManager() etc. No biggie.
Now I’ll try running it to see if it’s all good so far…
Cock… Right, to LogCat. What have I done wrong?
Right. I don’t think I’m jumping to conclusions to guess that it’s something to do with that OpenGL ES 2.0 reference from earlier…
How do I find out what went wrong then?…
Best bet is usually check out the documentation/comments within the library that you’re using. I just did and found this from here.
There’s talk of emulator issues with hardware acceleration. I’ll try on actual hardware to see if that’s the issue.
Sure enough. Works fine on hardware! Rather than implement a workaround as suggested, I’ll just crack on with my physical Nexus 5. Life’s too short, and this is just a hobby session.
This looks very familiar, very Google Maps like, which is what I’m sure they were going for in order to reduce boundaries for adoption to existing developers – don’t make us work too hard, always a good idea.
Rather than read docs or do trial-and-error to see what the format is of such a grid point. I’ll just punt it out from a touch input in that OnMapClick listener method, straight into LogCat.
Then I’ll run the app on my phone and tap it a couple of times to see what I’ve got.
Interesting. So it’s a six-figure reference with no decimal accuracy as far as I can see. Every tap yields a .0 on the end. Reckon that’s just an OS grid reference stored as a Double? I’ll have a look here.
Confirmed! Progress then. It should be trivial then to add markers. I’ll find somewhere interesting, get the grid ref and try it out.
It needs a string for a label, and a BitmapDescriptor for an icon. I’ve borrowed an icon from here for that. Free for personal use (I’m not selling this little app, so I think that counts). What’s that look like then.
Ah…that’s a bit big. I pulled it straight from a Drawable. I’ll make it a Bitmap and resize it. I also need to make it zoom and centre on the marker that I just made, as I have to scroll to it at the moment.
At this point, I got lazy with the typing and just ploughed on with a little demo app… So this last bit is brief. (you can skip to the GitHub repo at this point and read the comments)
I thought the helmet and Silverstone was a good start, so I went on Wikipedia and found the locations of all of the permanent UK racing circuits, converted the listed Lat/Lon to OS Grid references using this handy site again, and manually added them to an ArrayList.
The array list is then parsed and adds the markers to the map. I set a 3000m per pixel value for the zoom, so it sort of pops out when you open up the app.
That’s it. Check it out on the GitHub repo if you want to see the super-simple implementation.
I’m forcing myself to take a couple of hours off to review the last twelve months, because I realise it’s been over 3-months since I wrote anything on here, and fun stuff like writing is one of those things that stays at the bottom of a todo list unless you force it to the top on occasion.
I had grand plans to keep this blog updated multiple times a week, with insights gained on my travels and gorgeous photos of Canada’s natural beauty and rich, exciting urban centres, that wasn’t to be. I changed my approach when I was only in my third province, partly due to the fact that I was stacking up way too much draft content and actually finishing none of it, partly because I had more photos than I knew what to do with (~21,000 since I landed on Canadian soil so far, yes really) and partly because it takes time to write things up into something worth reading, and I wanted to enjoy the experience of being in these places that I was traveling through, rather than just being a meat-camera, capturing and regurgitating visuals and anecdotes to be deposited on the interwebs.
I’m not going to document every last place that I visited, as if I did that I’d have nothing to tell you when we next meet up. Instead I’ll start gain from here, and I’ll include some photos of my travels as and when;
I now have my own personal stock photo library (a major bonus to travel that I hadn’t considered before setting off) – so some advice: do not hit the road with a crappy camera. I still hate to look at the grainy crap that I got out of the first generation Epson digital camera that I took to South America more than a decade ago, I’ve always been an early adopter like that, but in retrospect a film camera would’ve recorded the experience way better (even if it was cool to be the only person I knew with a digital camera at the time).
My camera choice this time however, was boss. It’s that thing in the image above; a Nikon D5200 body, with Nikkor 50mm 1.4G lens on it. I also took a borrowed Nikkor 55-300mm (thanks Mum). In retrospect I could’ve done with a shorter focal length lens for close shots, but the combo was perfect for landscape and environment shots. The 50mm in particular absolutely killed it for night photography, and I’m so glad I had it when I was up in Whitehorse checking out the Northern Lights.
The float plane flight around Vancouver was spectacular. I’ve always wanted to go up in one of these and my Harbour Air experience did not disappoint.
As I’ve mentioned before a lot, the Northern Lights in Whitehorse was an incredible sight and one that I didn’t expect to see on my trip (it was a last-minute “ah sod it, now or never” decision to fly up from Vancouver). Though the people I met up there was as much of a highlight as the location. The Yukon is now one of my favourite places, anywhere.
Solo mountain-biking in Jasper was another highlight. I got some incredible photos, but actually being there was mind-blowing. You can’t believe that you’re not viewing something that’s been photoshopped at times. It’s not cheap, and it’s super-touristy downtown, but if you can get out of the urban area a little there’s still a whole lot of wild Canada to explore.
I didn’t expect to get as far north as Dawson City, so I definitely didn’t expect to find myself in the Arctic on the way to it. A completely random series of events ended up taking me to Inuvik by prop-plane. The view from the window on the flight up made me re-assess my understanding of the concept of scale. Seeing the rivers become dog-sled highways was as surreal as it was exciting.
These huge lumps of Canine Gin & Tonic (Eh? … 😉 ) float their way down from Greenland’s ice sheet, loiter off the coast a bit, then end up in a bottle of one kind or another. There are actual boats with huge grabber things on them that pluck chunks of ‘berg for the sole purpose of being put into alcohol production. I’ve now drunk iceberg in both beer and wine formats; both are delicious.
If you’re going to skip these provinces on your Canadian travels, you’re doing it very wrong. Best seafood you’ll ever eat in your life, and you can probably see the boat that brought it in! If you’re not into fish? Err, best stay west. Unless you like Timmy’s; there’s always a Timmy’s.
In rural England, the most exciting thing you’re likely to see is a Fox. Not so in Canada; big, National Geographic-worthy wildlife is everywhere!
Overall however, the best thing about this past year has been the people I’ve met, they make the experience. It’s why I chose to go for hostel accommodation most of the way around Canada, because it’s impossible not to meet people that way.
That’ll do for now; it’s been a year to beat!
Challenge accepted. 😛
We caught a ferry over to the islands from Chandler in Gaspesie, and were looking forward to a nice cruise – private cabin, actual beds (a novelty when you’re camping for months on end) and a decent chance to check out the scenery. The photos on the website had led us to believe it would be thus; alas it was not.
The ship was a refitted Greek cruise ship, built at some point in the mid 20th century. Being refitted it seems referred to they way that it had old grot painted over in some places, sort of. The evening embarkation added to the sense that we were less on a pleasure cruiser than in a cold war-era film. I don’t want to dwell on this bit, so I’ll move on; in any case the ship acted as something of a palate cleanser for the beauty of the islands themselves, check it out.
The foundations of islands were created by the release of pressure in the Earth’s mantle, leaving protruding pillars of salt rising up from the seabed. Beause of this they are fragile and returning to the sea around the coastline. There are plenty of these signs, often mounted to safety fences tens of metres back from the edge of the cliff – that alone gives you an indication of the rate of erosion.
The islands are small and spread out; you can get to the end of the road at Grand-Entrée from Cap-aux-Meules in 40 minutes by car. The best way to see the central island of Cap-aux-Meules (the millstone cape) is by bicycle. There are places to hire bikes on Chemin Principal, the main shopping street on the islands. From there you can get all the way around the island via l’Étang-du-Nord, the Cap-aux-Meules lighthouse, La Belle Anse, up the steep hill at the east end of Chemin Léonard Aucoin, then the steeper one at Cheman des Caps, which takes you back to the top of Chemin Principal and back down hill with a view of the main port of arrival.
I’m going to wind-in the commentary here and just spam a load of photos – the pictures say it better than I ever could.
The islands used to be a powerhouse of fishing, but with the European trawlers tidily destroying that market with their industrial-sized ships vacuuming the surrounding waters, the Economusée scene is where it’s culinarily at.
At the time of writing I have achieved my goal of visiting every province in Canada; from the unique surfer idyll of Tofino on Vancouver Island, the rugged coastline at Cape Spear in Newfoundland, even up to the frozen lakes of the Northern Territories. The only location that I wasn’t able to pass through was Nunavut; but if I had, I’d have no excuse to come back; I want an excuse, Canada is a fantastic country. The biggest take-away from my trip is scale. From taking off in London to the last point of my actual trans-Canada trip, I have travelled a distance greater than the distance around the circumference of the Earth, and I didn’t have to leave Canada to do it!
I can be sure of this distance total because I kept my Google Location History on for the entirety of the trip and manually added any places that I missed from when my devices were out of charge. This yielded the pretty cool (if I say so myself) map of my travels that you can see below. By pulling the data from my Location History page and applying the Haversine formula to get the distance between each point I got a total distance of 51,046 km. Taking the Wikipedia figure of equatorial circumference (40075.017 km), I get 1.27 times around the world. Not bad for a five month trip. I’ve also drafted a tutorial on how to do that, and have written up some PHP scripts that I’ll be open-sourcing soon.
I kept the “every province” goal under my hat, as I didn’t honestly think that it was possible on my timescale, and I stuck to my promise to myself that I would only move on to the next place once I was satisfied that I had seen what I wanted to in that location; I didn’t want my first trip to the second largest country in the world to be rushed. Now I’ve managed to visit every province in Canada (although only one of the two territories – I’m still calling that a “win”) I thought that it would be a good time to reflect on this beautiful and vast place. I’ve written some posts that will trickle out over the next few weeks, they are all under the “Canada” category, and I hope that you enjoy reading them.
If you don’t enjoy reading them, that’s fine too. Just send me some comment-abuse (any attention is good attention) and look at the pictures – there are a lot of them; I’ve taken over 15,000 since I got here…
Taking the cheapest way from Banff to Toronto, whilst breaking my own personal record on the amount of time on a bus, seemed like an ok idea and very cost-effective at only ~$200. The train wasn’t running when I needed it to, and the flight was going to be $322, plus $18 fare for a bus to Calgary. $140 is a lot when you’re trying to make your money stretch out, and as I didn’t have any deadline to get anywhere, I traded time for money and went with the Greyhound. That alone was a tough decision, after they lost my bag last time…but they’ve pretty much got the route locked down, so no other operators had an equivalent journey for me to take.
So the bus was definitely the right choice this time. I was convinced. But you can’t be right all of the time.
I wrote the odd fragmented note into a draft on Evernote, one of the apps that I recommend for travel when you’re not sure if you’re going to have an internet connection the whole time.
This isn’t so bad.
I’m snoozing a lot. I’m doing a pretty good impression of a nodding dog. Or was, up until I executed a perfect headbutt onto the edge of my MacBook. I’m awake now, with a deep red line on my forehead… I am quite awake now, a throbbing head will do that. Need coffee.
Is this a dream or am I still awake? Weird twilight in Sasketchewan doesn’t help – flat prairie could just be my mind running out of ideas in my dream. A single tree on an endless plain? Come on, that’s gotta be fake. “Kzzzzrt” the bus driver’s voice crackles onto the overhead speakers. No way…this is real?! That sky is blatantly photoshopped…
Ow wow. I need some fruit. My stash was NOT big enough, but I’m damned if I’m having a Timmy’s for breakfast. I found some bags of nuts at the services. Pretty salty, but at least they’re whole foods.
Couldn’t wait any longer. The serial gum chewing wasn’t cutting it. Brushing my teeth at a bus depot; new personal low. I both look and smell like I’ve been camping. In a bin.
If there’s an airport in the next town, I’m getting a plane to Toronto. Screw this. No come on, you’ve come this far. It’s just a bit of sleep deprivation kicking in, you’re fine. You’re right. Who said that?
Why isn’t my phone charging? What?! The power’s broken?? Damnit Greyhound! At least I got to sort through some older photos before the power went out. My primary form of entertainment currently is writing on Facebook about how terrible bus travel is.
So close… Need caffeine if I’m going to salvage my sleep pattern here. Day and night are becoming meaningless terms. Coffee and a greasy McDonald’s bagel is in order – healthy eating be damned. I NEED comfort food.
I’m going to have to burn these clothes…
I’m in Toronto! I walked up and down some streets unnecessarily for a while as I was phone less by the time I got here; battery flat by now obviously. Thanks Greyhound… So this is actually on my laptop when I arrived.
I need to get some sleep and a proper meal. Or, you know. Go on a bar crawl with some new friends I just met at the place I’m staying. That’s a tough one…
That’s my first thought, and I giggled to myself at the ridiculousness of the situation. It’s 3:30am, I have just arrived in Jasper, I have nowhere booked to stay, and the bus company has just lost my bag. I’ve been on a bus for 32hrs and I am in severe need of a shower and a change of clothes. That’s not going to happen – the bus driver tells me that it must be on the bus to Edmonton, and it won’t be back through Jasper until Saturday. I had all of the gadgetry of the modern-day flashpacker in my camera bag that I carried onto the bus, but only the increasingly pongy clothes on my back to wear.
My mind flashes back to the connection at Prince George bus depot; I had the presence of snoozymind® to walk over to the last bus and check that there was nothing left on it, but was shooed away by a bag zombie who said that no customers could be near the coach during loading. At the time I wasn’t that bothered, and quite keen to get on the next bus and resume my snooze, but now I was now kicking myself for not pressing the matter and keeping eyes on my bag.
I sat on a bench and got my Mac onto the WiFi at the closed train station. I had received an email from Mike at the WTF hostel, which I’d booked for the following night, saying that I could just grab a bed in the dorm when I get in as there are beds free. Top bloke. I headed there and got a few hours kip in.
First thing in the morning I headed over to the Greyhound office at the train station, tooled up with indignant rage, ready to kick some metaphorical arse. I arrived to a see a little smiling old lady, who said
“Ah, Matthew? We’ve found your bag dear.”
Ah, bugger. That’s not what I was expecting. I was sort of looking forward to a ruck.
“Oh, uh, thanks!”
How, or where was a mystery to her, as it was left inside the door of the office when she got in in the morning. Regardless of how the bag fairy did her magic that night, the problem was solved. It was however a valuable experience, as I had to (for the second time this trip) go through a worst-case scenario checklist in my head.
Here are some tips for if you ever get into such a situation, and what to do upfront in order to mitigate the pain should it ever happen to you.
Are you covered by travel insurance? For total loss, just delays or both? The time that you need to know this is when you panic, that’s when you need to know if you can book into a hotel and relax until you’re thinking straight, or if you need to find a 24hr coffee place to sit in whilst you deal with the situation. Most importantly you need to check what your delayed baggage allowance is, so you know how much you can spend whilst delayed without being out of pocket in the long run.
I was a bit anal about this and laid out all of my kit on a table before I left so that I could document what I was taking with me. But I didn’t always do this once I’d started to acquire things along the way, so if you treat yourself whilst away (to a new backpack for example) make sure that you take a photo and show off to your mates – it’ll actually come in handy if it ever goes missing and you need to prove that you owned it.
This seems like a “duh” point, butI had been a bit lax in the previous few weeks. When I first arrived in Vancouver my passport was in a zipped pocket all the time, always on my person; I was in UK city mode. After that I had moved it to my documents folder which is too big for my camera bag so lives in my rucksack – I wasn’t crossing any national boundaries so it seemed overkill for a bus trip.
I had decided when I was in Whitehorse to rearrange my rucksack, as I had way too much crap that I didn’t need in there. In doing so I transferred my passport to my camera bag, as when I get to an airport eventually I’ll have to dig it out of my rucksack anyway and it’d save me some time in the future, as I tend to be that guy whose name gets the last call over the PA system. This turned out to be an excellent move.
It meant that when I was stranded in Alberta with nothing but gadgets, I had the “fly the **** home” option in my back pocket. That’s a nice thing to have.
People are cool, and you can blog about it later. 😉
(as ever, the majority of these photos have nothing to do with the post, but they were taken in Jasper!)
The whole point of my little trip to Canada was that I wanted it to be almost entirely unplanned. Having worked in an office where I knew I was going to be every day and what I needed to be doing ages in advance, I wanted my travel to be a little more unpredictable. Fortunately technology makes that sort of trip both easy and economical.
The following are the apps that I find myself using on a daily basis; I have no association with any of them, I am sharing this info because I genuinely find them useful. I hope you do too!
This is hands down my favourite way of booking a flight, on a mobile or otherwise. It works like the flight comparison sites, but it far slicker than most and is optimised for mobile use.
You can create multiple tabs for specific searches to refer to later, so if you are planning a series of ‘hops’ and want to tweak the specific dates and airlines, you can do so by creating a tab for each journey and switch back and forth between them for comparison.
By far the best feature of this app is the price comparison chart (see vid above), especially if you aren’t constrained by when you have to fly. Enter the origin and destination airports, select ‘Any’ in the Depart date field and hit search. You get a horizontally scrollable chart showing dates along the bottom, and bars of different heights representing flight prices on each date.
For the ultimate in random, cheap flight searches, choose ‘Everywhere’ as your destination airport and see the cheapest place that you can fly to on any date from whichever departure location that you choose! Great for an unplanned, last minute weekend getaway.
You’ll save mb’s, and it’ll be a much smoother experience.
Nothing beats this for keeping track of little snippets of information that you learn from people that you meet along the way. You could use a Moleskine if you’re an analogue type, but if you lose that little book, it’s gone. Evernote backs everything up, and can record where you were when you took down the note so making it easier to refer back to to later: “Which hotel did that guy in Tofino recommend again?..”
I also use it for keeping track of touristy maps and leaflets, partly so that I don’t end up with a bag full of paper, but also because it makes you look less like a tourist if you’re just checking your phone, as opposed to unfurling some A1 sized glossy map on a bench somewhere (I prefer to blend in and not look like a tourist where I can, especially when traveling solo).
Check out Bod for tea’s great crowd-sourced post on other uses if you’re blogging about your travels as you go.
I use Drive for keeping hold of reservations, confirmations and electronic boarding cards for flights, which are increasingly used at airports to reduce the amount of wasted paper involved in frequent travel.
I sync my ‘Travel’ folder from my desktop, so when I make any bookings with my laptop, the PDF print-outs are synced to my phone automatically, so when I get to the baggage check I can just get the QR code on the screen scanned rather than having to dig around for a crumpled card pass jammed somewhere in a side pocket.
It’s a great feeling to check in online, from a WiFi-enabled shuttle coach en route to the airport, then walk past the check-in queues straight to the departure gate with a smartphone boarding pass, fifteen minutes before take-off. That’s how air travel should always be.
Worried about privacy? Please…you’re using the internet to book flights. Google already knows where you’re flying. 😉
For photo-backup. This is a bit trickier to set up, but worth the effort. OwnCloud is a Dropbox-like cloud storage system that you install on your own machine; be that server or home machine that’s always-on. Once set up, you can install the app and have your phone camera photos backed up automatically when you’re in range of WiFi (or even over mobile data, if you’re really brave/have unlimited data!).
Unlike Facebook or Google+, the full-sized image file is uploaded, with all of the extra EXIF data, geolocation and original timestamps, so you don’t lose detail or resolution when it syncs. It reassures me that if my phone breaks or goes walkies, I’ll still have all of the photos that I took with it on a server back in England. It also allows me to delete all of my photos from my phone to free up space to take more!
Dawson City, YT at the quiet pre-tourist time is a largely empty, sleepy town. The people are friendly, and the pace of life is slow. There are no traffic signals, concrete pavements or chain-owned shops to break up the atmosphere of this century old mining town.
I chose to make most of these photos black and white because it suits the character of the place.
I’ve been on a bus more often this past month or so than I have for the past decade. Whilst naturally traumatic for the petrol head, I’ve collected together some tips of how to make use of shared automotive transport less terrible.
(The photo below was taken from a bus, because who wants to see a picture of one?!)