Mark Goodge | 4 Jan 15:04 2011
Picon

Geographic/ceremonial county lookup

Does anyone know if there's a website anywhere with either an API or a 
downloadable dataset that can relate locations (either lat/lon, postcode 
or OS grid) to their appropriate ceremonial/geographic counties?

MapIt is very good for what it does, but it returns administrative 
rather than geographic divisions. So if a location is in a Unitary 
Authority then that's all you get, rather than the ceremonial county 
that the UA is within. What I'm looking for is something that, for 
example, will return Staffordshire rather than Stoke-on-Trent, and 
Somerset rather than North Somerset.

Any suggestions?

Mark
--

-- 
http://mark.goodge.co.uk

Paul Waring | 4 Jan 15:14 2011
Picon

Re: Geographic/ceremonial county lookup

On 04/01/11 14:04, Mark Goodge wrote:
> Does anyone know if there's a website anywhere with either an API or a
> downloadable dataset that can relate locations (either lat/lon, postcode
> or OS grid) to their appropriate ceremonial/geographic counties?

I think you could scrape Wikipedia to get that sort of information, as 
it tends to have geographical data for postcode areas - for example:

http://en.wikipedia.org/wiki/BL

You might have to follow some of the links to get the information you're 
looking for though - i.e. it won't all be on one page.

--

-- 
Paul Waring
http://www.pwaring.com

Paul Robinson | 4 Jan 15:22 2011

Re: Geographic/ceremonial county lookup

On 4 Jan 2011, at 14:14, Paul Waring wrote:

> On 04/01/11 14:04, Mark Goodge wrote:
>> Does anyone know if there's a website anywhere with either an API or a
>> downloadable dataset that can relate locations (either lat/lon, postcode
>> or OS grid) to their appropriate ceremonial/geographic counties?
> 
> I think you could scrape Wikipedia to get that sort of information, as it tends to have geographical data
for postcode areas - for example:
> 
> http://en.wikipedia.org/wiki/BL
> 
> You might have to follow some of the links to get the information you're looking for though - i.e. it won't
all be on one page.

I think you need to stick "_postcode_area" to the end of that:

http://en.wikipedia.org/wiki/BL_postcode_area
http://en.wikipedia.org/wiki/EC_postcode_area
http://en.wikipedia.org/wiki/L_postcode_area
http://en.wikipedia.org/wiki/M_postcode_area

etc.

You can start here:

http://en.wikipedia.org/wiki/List_of_postcode_areas_in_the_United_Kingdom

If the "local authority area" is all that's needed from the _postcode_area pages, you can look at the
original data Wikipedia uses:
(Continue reading)

Matthew Somerville | 4 Jan 15:54 2011

Re: Geographic/ceremonial county lookup

On 04/01/2011 14:22, Paul Robinson wrote:
> They seem to be using Code-point Open which is available as a CSV
> which is free of charge as a download (but obviously, that doesn't
> make it "free" as in speech).

Though, to be clear, it is. The OS OpenData licence is interoperable 
with the CC-BY 3.0 licence; hence http://mapit.mysociety.org/ being able 
to exist as it does :)

ATB,
Matthew

Francis Davey | 4 Jan 16:07 2011
Picon

Re: Geographic/ceremonial county lookup

On 4 January 2011 14:22, Paul Robinson <paul@...> wrote:
>
> If the "local authority area" is all that's needed from the _postcode_area pages, you can look at the
original data Wikipedia uses:
>
> https://www.ordnancesurvey.co.uk/opendatadownload/products.html

The WP "local authority area" will often fail to be a ceremonial county, see:

http://en.wikipedia.org/wiki/CH_postcode_area

CH postcodes are in multiple ceremonial counties (eg Cheshire,
Merseyside) which aren't listed (instead: Cheshire West and Chester,
Wirral etc). CH1 is not only in more than one ceremonial county, it
crosses national boundaries 8-).

I'm glad to see the OP has a solution.

--

-- 
Francis Davey

Paul Robinson | 4 Jan 16:14 2011

Re: Geographic/ceremonial county lookup

On 4 Jan 2011, at 15:07, Francis Davey wrote:

> The WP "local authority area" will often fail to be a ceremonial county, see:
> 
> http://en.wikipedia.org/wiki/CH_postcode_area
> 
> CH postcodes are in multiple ceremonial counties (eg Cheshire,
> Merseyside) which aren't listed (instead: Cheshire West and Chester,
> Wirral etc). CH1 is not only in more than one ceremonial county, it
> crosses national boundaries 8-).

Sounds like somebody (here?) should go about fixing the Wikipedia pages?
Francis Davey | 4 Jan 16:21 2011
Picon

Re: Geographic/ceremonial county lookup

On 4 January 2011 15:14, Paul Robinson <paul@...> wrote:
>
> Sounds like somebody (here?) should go about fixing the Wikipedia pages?

No. The pages are correct. They list local authorities rather than
ceremonial counties. Merseyside hasn't had a local authority for quite
a while now. You can indirect via the local authority name to the
containing ceremonial county:

http://en.wikipedia.org/wiki/Metropolitan_Borough_of_Wirral

Which is just one more step. Its in the infobox, so bound to have been
picked up by bits of the semantic web, though annoyingly freebase
doesn't seem to have put the local authority <=> ceremonial county
into its database:

http://www.freebase.com/edit/topic/en/ceremonial_counties_of_england

--

-- 
Francis Davey

Matthew Somerville | 4 Jan 15:18 2011

Re: Geographic/ceremonial county lookup

On 04/01/2011 14:04, Mark Goodge wrote:
> What I'm looking for is something that, for example, will return
> Staffordshire rather than Stoke-on-Trent, and Somerset rather than
> North Somerset.

As you say, it's just a manual lookup. http://whatcountyamiin.co.uk/ is 
what I wrote for a friend; source code is at 
https://github.com/dracos/whatcountyamiin.com with 
https://github.com/dracos/whatcountyamiin.com/blob/master/unitary_to_county.js 
doing the main council -> county lookup (for those non-London, non-NI, 
no county council).

If someone wanted to alter mapit - source code at 
http://github.com/mysociety/mapit - to automatically add a county to all 
results using a fixed lookup along those lines, then that would be great.

ATB,
Matthew

Mark Goodge | 4 Jan 15:26 2011
Picon

Re: Geographic/ceremonial county lookup

On 04/01/2011 14:18, Matthew Somerville wrote:
> On 04/01/2011 14:04, Mark Goodge wrote:
>> What I'm looking for is something that, for example, will return
>> Staffordshire rather than Stoke-on-Trent, and Somerset rather than
>> North Somerset.
>
> As you say, it's just a manual lookup. http://whatcountyamiin.co.uk/ is
> what I wrote for a friend; source code is at
> https://github.com/dracos/whatcountyamiin.com with
> https://github.com/dracos/whatcountyamiin.com/blob/master/unitary_to_county.js
> doing the main council -> county lookup (for those non-London, non-NI,
> no county council).

Excellent, that's just what I need.

Cheers

Mark
--

-- 
http://mark.goodge.co.uk


Gmane