LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] OT: Open Source Postcode

[ILUG] OT: Open Source Postcode

Keith Gaughan k at stereochro.me
Mon Jul 11 18:42:03 IST 2011


On 10/07/11 21:59, Ian Spillane wrote:

> I realise that it is not strictly Linux related - more Open Source -
> but I'm hopeful Linux people are just as much concerned about open
> source.
> 
> As you probably know, there's talk of a postcode for Ireland; however
> it's a bit of a worry that the main proposals are proprietary,
> closed-source, randomised, license-fee based codes.

Just a quick note: I don't know what you're using for the checksum algorithm,
I couldn't see mention of it on the site, but I just be blind. There's a
checksum algorithm that's commonly applied across the EU (with different
variations for the weight and divisor) for the likes of PPS and VAT numbers.
The algorithm is:

def checksum(weights, val, divisor):
    total = 0
    for weight, digit in izip(weights, val):
        total += weight * int(digit)
    return total % divisor

'weights' is a list of multiplicands applied to each digit to give their value
a weight. 'divisor' is divided into the total to get the modulus which will be
used as the checksum. You're most of the way to Luhn's formula if you use
weights of [1, 2, 1, 2, ...] and 10 as the divisor.

For PPS and non-legacy VAT numbers, the method used for checking if the number
is valid is this:

def mod23(val):
    """
    Irish PPSN and VAT numbers include a simple checksum at the end;
    this function checks this to verify if the PPSN/VAT number is well
    formed.

    >>> mod23('8473625E')
    True
    """
    checksum = checksum([8, 7, 6, 5, 4, 3, 2, 1], val[:-1], 23)
    # Checksum letter is A..V for 1..22, and W for 0,
    # which we turn into 23 for ease of lookup.
    if checksum == 0:
        checksum = 23
    return chr(64 + checksum) == val[-1:]

It might help gain traction if a variation on this checksum were used.

> I've proposed an open source postcode (well actually, calling these
> postcodes is just shorthand - they are all more precisely compressed
> positioning coordinates) at http://tinyurl.com/openpostcode and have
> put together the maths and proof of concept tests. However, I lack the
> skills to easily create a javascript interface with a Google Map - to
> really open up the concept. I hope for advice from those that know
> about how to get such an open source project to build a community and
> to grow in awareness.

My main reservation is that it doesn't help An Post much. There's a reason
why UK postcodes are structured the way they are: to make mail routing
fast: somebody looking at the postcode can tell exactly where it's meant to
be routed to. Geographic co-ordinates get you half-way there, but An Post
would still have to using some kind of mapping from post prefixes to sorting
offices, which would get in the way of manual sorting (which is still
necessary, even today).

Aside from that, the system looks good!

> It will be an awful shame if the government opt for a closed-source
> proprietary code that open source programmers and database people
> can't freely handle themselves to generate their own location data.
> 
> http://tinyurl.com/openpostcode

For that, a consortium of some kind will be needed to put its weight behind
it[1], and some way of demonstrating that the system needs no support.

As others have said, you should talk to the OpenStreetMap people.

K.

[1] Which is silly, because something like this ought to be judged on its
    merits rather than the amount of pressure the proposer can apply on the
    selection process, but then again, this is Ireland...


More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell