Converting Eastings and Northings to Latitude and Longitude in Alteryx
Converting UK eastings and northings to latitude and longitude is far quicker in Alteryx than wrestling with it at scale in Tableau.
- Use the Create Points spatial tool in Alteryx to turn easting and northing fields into a spatial point object
- Set the correct projection (British National Grid OSGB 1936, EPSG code 27700) rather than relying on the default latitude/longitude, and look up codes at epsg.io
- Add a Browse tool to visually verify your points, which makes it easy to spot if easting/northing or longitude/latitude are swapped
- Use the Spatial Info tool to extract the centroid as x and y fields, giving portable latitude and longitude for use in other tools
- Doing the conversion in Alteryx and outputting a hyper extract runs near-instantly and is faster than converting at scale inside Tableau
0:00Hey Tim here, in the 21.4 release I talked
0:02about a capability in map layers and
0:05essentially for one
0:06of those videos I had to use Altrix to
0:08convert eastings to northerners and
0:10essentially create
0:11an output using latitude and longitude. I
0:13actually used the point the centroid
0:15capability inside of
0:16Tableau but in this video I'm going to show
0:18you how I did that here in Altrix. This is
0:20the workflow
0:21complete we're going to take it apart and
0:22start from the beginning. I'm going to show
0:24you how to
0:24do this for yourself. Let's get stuck in.
0:26Okay so you can see here we've got the flow
0:28what I'm going
0:28to do is I'm just going to go ahead and
0:30delete this whole entire thing so we can
0:32start from the
0:32very beginning and I can show you the
0:34fundamentals. The first thing I've done is
0:36I've connected to my
0:37data set and you can see a little preview
0:39of it here on the left hand side and this
0:41preview is
0:41kind of handy because it gives you an idea
0:43of what's in your data set. Now the next
0:45thing we
0:46need to do is to actually use the spatial
0:48data and if I just pull up my browse window
0:50here you can see
0:51that I've got the location eastings and
0:53northerners and in the UK that's the
0:55standard way that you
0:56know governments use to map data
0:58essentially. This helps sort of give an
1:00equivalent to latitude and
1:02longitude in the UK. So we need to convert
1:04this before we can actually do something
1:06with it
1:06inside of Tableau. You could do this
1:08directly inside of Tableau but because of
1:10the scale of
1:10the state it's actually faster to do it in
1:12Altrix and have a hyper extract already
1:15created in Altrix.
1:16So let's go ahead and do this. The first
1:19thing I'm going to do is to get the create
1:21points
1:21capability. Just up here you can see that I
1:24'm actually in the spatial section of the
1:26Altrix
1:27interface. So you can see that up here
1:28spatial is selected just behind my little
1:30annotation window
1:32and I've gone to the create points function
1:33here and I'm just going to drag that in
1:35there.
1:35Now if you can't find this just go to the
1:37search at the top and type in create points
1:39and then you'll be able to sort of drag it
1:41in from the canvas like that as well. So
1:43no worries if you can't find it. If you
1:45haven't got spatial enabled then you need
1:47to go to this
1:48little plus icon and make sure that you can
1:50see the spatial section here selected. Make
1:53sure that's
1:53selected and then you're going to be pretty
1:55much good to go. So we've got this create
1:57points
1:57function in but now we need to give it some
1:59information and so what we need to do is to
2:01give
2:02it the correct information. So for this
2:04longitude I believe is northing and
2:06latitude I believe is
2:08easting. If I've got this wrong we'll know
2:10when we visualize this inside of Altrix
2:11when it runs.
2:13The other thing I need to do is to tell it
2:15what projection is being used. It's not the
2:17standard
2:18latitude and longitude so what I have to do
2:20is to go into this tiny menu here on the
2:22left and if you
2:22click these three dots what it actually
2:24does is it opens up an interface where you
2:26can go and search
2:27for the one you need. Now the one I need is
2:29actually the UK one and I know that's up
2:31here at
2:32the top British National Grid OSGB 1936.
2:36The actual code for it is 27700. If you're
2:40in doubt
2:41you can go to a website called epsg.io and
2:43find all these codes and pretty much figure
2:46everything
2:46out there and then come back in here and
2:48search for it. So let's hit okay and now
2:49that we've done
2:50that we're pretty much ready to go and what
2:52we can do is we can just test that this is
2:54working.
2:55So let's add a browse tool. I don't always
2:57need to add a browse I could just use the
2:59output
3:00node from that particular tool but this
3:01will show me straight away that I've got
3:03those two locations
3:04the wrong way around. I can tell because it
3:06sort of looks like it's been rotated the
3:08other way and
3:09so what we need to do is to switch these
3:10things and all things back. So this is the
3:12great thing
3:13when you can actually see your data you can
3:14kind of make these mistakes and not really
3:16worry.
3:16Imagine if you were coding this you'd have
3:18to get this the right time because it might
3:20take a while
3:20to run and you can't just sort of fail fast
3:22as it were. So now this looks correct this
3:25is the
3:25correct thing. I can never remember which
3:27way those two round which way round those
3:29two go so
3:30you know here we are. So now that I've done
3:32this I can actually see if I scroll to the
3:34right and
3:34just move my face out of the way you can
3:35see that I've got this centroid that I can
3:37actually use in
3:38Tableau but what if I need to make this
3:40data a little bit more portable and I want
3:42the latitude
3:42and longitude to use in other tools. Well I
3:45can do one more step here which is to go
3:47and grab the
3:47spatial information of the centroid. So
3:49what we'll do is we'll grab this little
3:51spatial info icon up
3:53here at the top and we'll drop it into the
3:55flow and you'll see that we get a bunch of
3:57options. Now
3:58one of those options is to take the cent
4:01roid as x and y fields okay and because this
4:04time we want
4:05it to go to the latitude and longitude we
4:07can actually leave the default down here as
4:10it is.
4:10If we wanted to change this back to easting
4:12and northerings we could again go to the
4:14same option
4:14with these three dots down here on the
4:16bottom and then change that but we don't
4:18need to do that here
4:18we can just keep pushing forward. So now
4:21let's run this flow again I can't I keep
4:23moving my face
4:23everywhere so I think I'll just move it to
4:25the bottom left here because it's out of
4:27the way
4:27and now when I click on the output and I
4:29scroll to the right we not only get the
4:31centroid but we
4:32now also get the latitude and longitude
4:35created for us. We can then create the file
4:37from this so
4:38we can just go to the output step here grab
4:40the output put it in link these two up and
4:43then select
4:44them and then now we can just go ahead and
4:46select the hyper file so we can put this in
4:48tableau and
4:49you can see that I've already done this
4:51already so I'll actually call this bus data
4:53version two
4:53just because it's for this demo and if you
4:55head to the description of this video you
4:57can find this
4:58workflow pop packaged and sort of download
5:00it and use it to your heart's content. So
5:02let me save this
5:03and then run this and you can see how fast
5:05this runs it's almost instantaneous. So
5:08there you go
5:09that's pretty much how I did it in that
5:11video and this is what I've used in the
5:12tableau explainer as
5:13well. So hopefully you found this useful as
5:15a way of understanding how to convert
5:17things from
5:18eastings and northings or to pretty much
5:20any other you know spatial projection that
5:23you want. You can
5:24you can you can pretty much pick anything
5:26from this list and to suit it to sort of
5:29your heart's
5:29content. So that's pretty much it from me
5:32thanks for watching and I'll catch you in
5:34the next video.
In this video, I show you a quick workflow I made to help speed up a process in Tableau 2021.4
00:00 - Intro 00:27 - Connnecting to my data 01:16 - Create points capability 02:01 - Select coordinate points