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
>> 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:
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
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
> 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.
For that, a consortium of some kind will be needed to put its weight behind
it, and some way of demonstrating that the system needs no support.
As others have said, you should talk to the OpenStreetMap people.
 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...
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!