universal pluscode to local postcode/zopcode converter?

57 views
Skip to first unread message

River Mersey

unread,
Oct 4, 2019, 1:22:56 PM10/4/19
to Plus Codes Community Forum
[Just had a quick search or previous threads and couldn't find anything on this.]

Does anyone know how to use either lat/long or pluscodes to generate a postcode for the specified location?

Possibly a lookup table to be used in a database or spreadsheet?

Many thanks

Barry Hunter

unread,
Oct 4, 2019, 1:36:52 PM10/4/19
to River Mersey, Plus Codes Community Forum
Well in general Plus Codes are kinda intended to be most useful in areas that dont already have a viable postcode code system. So may not be a viable postcode system (just using name postcode for brevity, some places say zipcode) 


But seems you want a reverse geocoder. The act of turning a location (be that lat/long directly, or lat/long extracted from plus-code!), into an 'address' (be that a textual address, or simply a postcode!) - is the job for a reverse geocoder. 

... powered by huge lookup tables. ie a 'postcode reverse geocoder' - literally needs a database of every postcode and its location. So searches for the nearest postcode to the search location. Not something that can be viably done in a 'spreadsheet' really. 

Many countries have large numbers of postcodes, and so a function that has worldwide coverage is a big database. 


A webservice is typically the easiest way, as they have done the 'heavy' lifting of importing the zipcodes, and building a search function. 



This also demonstrates in theory one of advantages of plus-codes, ie the location data is* encoded into the code itself. Rather than being 'lookup table' based. 

* mostly anyway! ironically some types - short plus-codes - still need a geocoder lookup to extract the location!)  








--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/open-location-code/28d066e4-bebd-403a-aac5-6162f3c85186%40googlegroups.com.

River Mersey

unread,
Oct 18, 2019, 10:56:27 AM10/18/19
to Plus Codes Community Forum
Many thanks for your reply, Barry.

Using various web resources, I think I've found a solution to what I was hoping to do! Yes, you are correct that this may only be possible using a rather large lookup table - and that is what I've done. Luckyly, we in the UK already have a public database of postcodes vs geolocation coordinates. So, using the GitHub description of the specification of pluscodes, I've written a prototype VBA script for MSAccess to convert lon/lat to plus codes. Given that the postcode list contained around 1.77m records, my script did well in generating that many pluscodes in about 120seconds!

Please look on GitHub for my prototype script ( https://github.com/google/open-location-code/issues/364 )

Reply all
Reply to author
Forward
0 new messages