Leigh Caldwell wrote:
> I've been trying to look up Westminster constituencies on the excellent new
> MapIt service by ONS ID (e.g. D84 for Saffron Walden). However it appears
> that they are not coded in this way (except possibly in Northern Ireland).
> Instead I assume the area IDs used are the BoundaryLine primary keys (65654
> in this case). Anyone know if that's correct?

No; the mapit area IDs are just our internal IDs (carried over from our old
version, which is why they're odd in some ways); Boundary-Line primary
keys are not stable between versions. There were two reasons I didn't
import ONS codes for Parliamentary constituencies - firstly, they weren't
included by default so I'd have to write something and the new GSS coding
scheme for all areas is being introduced in January anyway. And
secondly, the ONS IDs didn't seem unique/stable - what were the IDs of
the constituencies before the 2010 election? It looks like they just
start at A01 and count up alphabetically, which could easily cause
confusion.

> Alternatively, it would be good to look them up by canonical name. I can do
> this by going to /areas/Saffron Walden and then parsing the results, but
> that also includes council wards beginning with Saffron Walden, so it's a
> bit indirect and means making an extra call to the web service.

What's the extra call? Going to the page you say, only one result has
the type WMC. Anyway, I see someone has shown you the type restriction :)
Personally, if possible, I'd just request /areas/WMC and match mapit IDs
up locally with your own IDs in a one-off process.

> The table of constituency names and ONS codes is available free from the ONS
> site and is a straightforward list of key-value pairs. Maybe I just need to
> write a data loader to import that and insert its contents into the codes
> table.

I would prefer it, given the changeover is happening anyway, if you
could perhaps think of switching to the 9-letter GSS codes, and writing
something to import them. :-) These codes will be stable, unique, and
permanently replace the current set of ONS codes.

ATB,
Matthew

_______________________________________________
Mailing list [email protected]
Archive, settings, or unsubscribe:
https://secure.mysociety.org/admin/lists/mailman/listinfo/developers-public

Reply via email to