I was annoyed; I’d already been waiting on my own in some run-down London pub for 15 minutes when I received a text saying, “sorry mate I’m just leaving… but get me a drink, I’ll only be 1 min”. I was still annoyed, but no longer because he was late; nor that the bar was terrible; not even that I had to buy him a drink. I was annoyed because the place we’d chosen to meet happened to be right by his house, despite being miles away from mine. I know you probably think this means I’m an awful person to go for a drink with (and you’d be right), but fortunately this isn’t about that; this is for anyone who has agreed and thought, “yes, friends are the worst”, and is about “How can we build something to solve it?”
Like any rational
human analyst, I left the dingy bar after finishing my dingy pint with my dingy mate and set about thinking how this problem could be solved. Before tackling the challenge at hand, I wanted to understand what the specific problem was, and the possible constraints defining it. I summarised them as being:
I determined this was a location problem, though I knew I’d need place information to solve it - and rather than pre-select thousands of venues, I’d want a way to dynamically access a huge volume of place data in any location, whenever the app was run.
So – with my obvious personality problems aside (there are some things even Alteryx can’t solve) – it was clear that this was a spatial and API dilemma that could be solved using Alteryx.
The rest of this blog is dedicated to the app’s user interface; how it’s built from a technical perspective; and my next steps with it. I’ve attached the app to the bottom of this post. Please feel free to download and try for yourself. All feedback is welcome!
Like many APIs, you’ll need to generate an access token to use the Google API. You can do that by signing up here.
Be sure to check both routes and places:
I have chosen to associate a card with my API (as doing so gives you free credit to do lots of calls for free), but be sure to read through any documentation here.
The app’s UI sits across three tabs:
Results are provided in a report, showing: where your travel polygons overlap, the top-rated places within that spot, and some other interesting points and images...
There are a few key tools that are integral to the app. Running the app in debug mode allows you to see exactly what each of these tools are doing.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=518746104,-0.110362243&radius=500&keyword=Bar&key=yourGoogleAPIkeyThis URL is effectively the search you might have done in Google Maps. We need Alteryx to do the work beforehand to find the perfect meeting lat long, but also, doing it via Alteryx allows us to return many more results than we’d see directly in Google, not to mention, see a lot more information about each place.
Recent refusal to meet anyone anywhere other than ‘the middle’ means I’ve got a lot of free time on my hands to test, improve, and add features. A couple of features top of mind I’m looking to include are, but not limited to:
… I assume (and hope) that nobody would ever want to use this to find the best rated dentist or zoo between them. But who am I to judge.
I’ve found that though the use case here is clearly ridiculous, the logic itself has easily been applied to client work with more relevant and useful business use cases.
As you can see, this is a work in progress; I’d welcome any feedback on the app, or to hear from you if you want to work together on this or something similar. I’d be happy to meet at a nearby zoo with a rating above 4.7 and a travel time of less than 27 minutes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.