UK postcodes: can only plot outward/outcode part. How to plot full postcodes?

I’m trying to plot UK postcodes on a map. Using the “Points on a map” visual, I can plot postcodes, but it only works if plotting only the outward/outcode part. If I try to plot the entire postcode, I get an “Some map data not rendered” error with detail of “The result of geocoding is ambiguous for 2 values” (if I’m just trying to plot 2 values for example)

Here’s a dashboard that shows a simple visual of the outward code working, but also showing that an identical visual not working if it tries to show the entire postcode

Postcodes

I’m told by a collegue that up to a few weeks ago, plotting the entire UK postcode used to work fine.

Is it possible to plot the locations of full UK postcodes? If so, how?

Here are a few suggestions for plotting full UK postcodes on a map in Amazon QuickSight:

  • The issue is that the full postcode may map to multiple locations, so QuickSight can’t unambiguously plot them. Using just the outward part (e.g. “SW1”) gives a more general area that can be mapped.

  • Try geocoding or enriching your postcode data in advance to get latitude/longitude coordinates for each postcode. Then you can plot those points directly on the map without relying on QuickSight’s geocoding.

  • Use a lookup dataset that maps postcodes to lat/long coordinates. Join your postcode data to the lookup dataset to append the coordinates, then plot those on the map.

  • Aggregate the data to a higher level like postal sectors or districts before plotting. This gives a more general area that can be mapped for each data point.

I would focus on resolving the ambiguity either in data prep or by aggregating to a level that gives a mappable area. Pre-geocoding the full postcodes to get coordinates is likely the best approach to plot specific points.

Hi Rhisoni,

Thanks for your reply. So the main point:

The logic is somehow completely the opposite of what I would have thought.

SW1A (which I think is the correct outward part in this case) and SW1A 2AY: both cover a range of locations, but SW1A is a strict superset of SW1A 2AY. So it would make sense to me if QuickSight did the opposite: erroring at SW1A due to ambiguity, and allowing SW1A 2AY.

In fact you seem to suggest that it’s possible outside of QuickSight:

So, at least logically, QuickSight could do this if it was coded up to do so? Do you know if it indeed used to as has been reported to me?

1 Like

Hello @michalc, while I am not aware specifically about issues related specifically to UK post codes, I know the mapping elements in QuickSight can be a bit buggy without full hierarchical geolocation fields or lat long fields. Did you try switching from the full postcode, SW1A 2AY, to the general post code of SW1? I am curious if that improved the ability to display the mapped value in the visual or not. Or are there other fixes you have tried to resolve this?

Hello @michalc, are you able to provide any further information regarding the question I asked above or other steps you have taken to try and fix the issue you are facing? With some more information about your debugging process, we can try to come up with a solution to this issue. If we do not hear back from you in 3 days, I will archive this topic. Thank you!

@DylanM Ah thanks for the reply (and the chase!)

Well not SW1, but to SW1A yes. That does work (which is what I was trying to describe in my original post). However, we would like to be more accurate than that, and plot full postcodes like SW1A 2AY.

Think we did also try it without the space as well, but that similarly didn’t work either (with the same error from memory)

Hello @michalc, are you able to add another layer of geographical hierarchy into your dataset? Do you have city names or something that you can pull from in your database? It might handle the granularity a little better with more detail to pull from.

Hello @michalc, since we have not heard back from you, I will archive this topic. If you still need assistance with this issue, please post a new question in the community and link this topic in your post. That will help provide relevant information to the QuickSight expert who assists you and it ensures you are at the top of the priority list for a response. Thank you!