Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This duplicates fields as there are essentially 2 city fields, the state/province should be expanded to include "counties" for UK, e.g. West Yorkshire, Cambridgeshire, Avon, Oxfordshire, Surrey, etc.
Luke.
Comment | File | Size | Author |
---|---|---|---|
#63 | location-corrected-location_province_list_gb-326665.patch | 10.26 KB | welly |
#62 | location-corrected-location_province_list_gb-326665.patch | 10.26 KB | welly |
#41 | 326665-40-uk_provinces.patch | 10.54 KB | nemchenk |
#38 | 326665-38.patch | 10.57 KB | hutch |
#20 | location.uk_.inc_.patch | 10.25 KB | TechnoBuddhist |
Comments
Comment #1
bdragon CreditAttribution: bdragon commentedNot sure I follow. Could you explain this one further?
Comment #2
Lucretia9 CreditAttribution: Lucretia9 commentedIn the state/province field you can select UK cities, such as Leeds, Peterborough, etc. These shouldn't be in this field. These cities would normally go into the "city" field and as it stands the form will contain 2 city fields.
In the state/province field, you should put the Counties as that is the closest UK equivalent. This is also what other (US) sites do. Thus, Leeds is in "West Yorkshire" and Peterborough is in "Cambridgeshire"
Luke.
Comment #3
uksigma CreditAttribution: uksigma commentedThe list of 'provinces' for England (known as counties) should be as per the list found here http://en.wikipedia.org/wiki/Shire_county
Bedfordshire, Berkshire, Buckinghamshire, Cambridgeshire, Cheshire, Cornwall, Cumbria, Derbyshire, Devon, Dorset, Durham, East Sussex, Essex, Gloucestershire, Hampshire, Hertfordshire, Kent, Lancashire, Leicestershire, Lincolnshire, Norfolk, North Yorkshire, Northamptonshire, Northumberland, Nottinghamshire, Oxfordshire, Shropshire, Somerset, Staffordshire, Suffolk, Surrey, Warwickshire, West Sussex, Wiltshire, Worcestershire
and these http://en.wikipedia.org/wiki/Metropolitan_county
Greater Manchester, Merseyside, South Yorkshire, Tyne and Wear, West Midlands, West Yorkshire
Wales, Scotland and Northern Ireland will also need to be included, but I'm not sure what the relevant county names are in each
Comment #4
Lucretia9 CreditAttribution: Lucretia9 commentedScotland and Wales have their own counties, so they should really be listed either under UK or under their own respective countries, depending on how you handle it.
But the ones you listed from the Metrolpolitan Counties also need to be listed as counties, they're not special AFAIK, they do exist, they're not pseudo counties or anything like that.
Thanks,
Luke.
Comment #5
La M CreditAttribution: La M commentedA UK county is the equivalent of Canadian province or US state.
In Scotland the situation is two-tier (or at least it used to be when I lived there): you have both a county (which they call a district) and a region that it is in.
In UK addresses, we generally have:
Address1: company name, building/house name, number, street
Address2: maybe a village
Town/City
County/District
Post code
Country, UK
A village is usually in or NEAR a town, a town is in or near a city and all of them are IN the county. Every UK address will have a county and a post code.
Rural addresses tend to be longer than urban ones because you would tend to have a house name and a village as extra information. And sometimes you would write the town as "Near such and such".
For example, a rural address might be something like this:
House name: The Old Smithy
House number and street: 14 Brook Street
Village/Town: Lower Piddlesthwick
Nearest Town/City: Near Malmesbury
County: Wiltshire
Post Code: MB1 2AB
or an urban address:
Number and street: Flat 15a Sea Way
Town/City: Brighton
County: West Sussex
Post code: SE2 3AB
or a business address in Scotland:
Company name: Barclays Bank Plc
Building name: Dukes House
Number and street: 1 Churchill Place
Town/City: Aberdeen
County: Kindcardineshire
Region: Grampian Region
Post Code: S14 5HP
London is a special case, in most cases people don't bother with London's county, and for the prominant areas, won't both with most of the post-code either:
Most people would write:
Kings College
Strand
London
W2
Whereas the full address is:
King's College London
Strand
London
WC2R 2LS
Comment #6
ctalley5 CreditAttribution: ctalley5 commentedThis has been throwing me off as well... that was a very helpful explanation. I see how that can cause confusion in any location/address module.
Comment #7
YesCT CreditAttribution: YesCT commentedrelated: #175193: Zip code database out of date (many UK issues linked there)
Comment #8
Lucretia9 CreditAttribution: Lucretia9 commentedActually, at work (where I put on addresses for people), sometimes there is no street.
Luke.
Comment #9
La M CreditAttribution: La M commentedCould somebody point me in the right direction for which Drupal file lists the UK counties please? Buskinghamshire is missing. Thanks
Comment #10
nickbits CreditAttribution: nickbits commentedHi,
I have been pulling my hair out with this one. I set a site up for someone (in the UK) using this module. They had been complaining that when they entered a "State/Province" it worked fine until they went to edit the node again where the field would be empty. I have been through caches, settings, etc. It's not until I found this post I realise that the module has a BUG in it.
That is, as already noted the "state/province" links to the town/city and not the county. This is outlined above. I cannot seem to find any information on a fix for this. Is there a fix? If there is, where is it? If not, will there be a fix?
Nick
Comment #11
nickbits CreditAttribution: nickbits commentedHi,
Forgot to ask, what other information do you need to be able to go from "postponed" to "active"?
Nick
Comment #12
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedHi,
I seem to be joining the party quite late here, but I wasn't happy that there were a list of cities in the uk province list(not the maintainers fault, there are too many countries for get all correct and counties are in a mess anyway) and started to do some digging.
Firstly the county system here in the uk is in a bit of a state. Traditional counties, day to day counties, admin counties and royal mail don't make it easier when they drop county support.
Given the mess, I looked at the office of national statistics and a few other places, none agreed with a complete list. So in the end I decided to try something that has probably been tested on a day to day basis year in year out by users... I looked at the county list provided by OSCommerce. There have been a couple of patches(de-duping, etc...) and its just the first one I tried, other carts will have their own and maybe a merge of all would be even better. This is as a starter for 10 and includes England, Scotland, Wales and Northern Ireland.
in location/supported/location.uk.inc I changed the function location_province_list_uk() to
after that I went to admin/settings/location/util and cleared the province cache.
"Leeds the city is now in West Yorkshire" not "Leeds the city is now in province Leeds".
It doesn't seem to matter that some of these are 4 char codes instead of 3, maybe a location dev could confirm this is good to go?
Does this help?
Oh, I also use String Overrides module to change the "State / Province" prompt to "County"
EDIT: Updated with Scottish counties.
Comment #13
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedWARNING!!
*IF* you use the above changes above in [#12] then you will need to change all the 'province' fields in your 'location' table. For me that means my users and my Organic Groups.
e.g. I had users with 'GLS', they needed to be changed to 'GLOU'.
New users and groups aren't affected and are fine with the new provinces.
If you wanted to avoid this then you could change the province abbreviations to something more aligned with your data.
Comment #14
eff_shaped CreditAttribution: eff_shaped commentedI'm looking into inserting UK counties to the location module (instead of the US states).
Can anyone explain what the point is of the abbreviations? How does drupal use them?
The ones in the list in comment #12 don't relate to abbreviations we actually use in the UK for counties.
Can I put the function location_province_list_uk() into my theme template and have it overide the location module include?
I would prefer not to go down the route of hacking a module, and keeping track of those hacks.
Comment #15
eff_shaped CreditAttribution: eff_shaped commentedI really wish there was some clear documentation on how to do this. As a non-programmer type, I need to know how these files all relate and where to put the code.
I've tried to do what I know - and it doesn't work for me. Help appreciated.
The information on this is all over the site and dates back for years. What is the current situation with Location module and how to fix this? For example, it's hard to tell whether things have been included in upgrades after any particular thread.
Comment #16
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedUpdate to #12 above.
After some more dev work, leading me right back to this thread and reading #14 and #15 I did some more digging around.
1. I don't know the point of abbreviations, I've not found out.
2. The county codes I used in #12 were not fully thought out and were a mix of 3/4 chars ISO-3166-1:GB, Chapman Codes and others. The county codes below are ALL 3 character codes from ISO-3166-1:GB and Chapman.
3. "Can I put the function location_province_list_uk() into my theme template and have it overide the location module include?
I would prefer not to go down the route of hacking a module, and keeping track of those hacks." - You won't be able to drop it in as "location_province_list_uk()" because all theme functions must begin with your theme name. I don't think it would work if you tried... but all you have to do is try it!! Something like "mytheme_province_list_uk()" should do, don't forget to use the location utilities to clear the caches.
4. If you're a non-programmer type, you shouldn't be tinkering with code. You need at least some coding knowledge before you attempt any patches or hacks. 1 missing character or 1 wrong character in the wrong place and your whole site could stop in an instant.
5. I agree there are hacks all over the place, but the developer is undoubtedly a busy person and doesn't have the time to add all the hacks into the module. It's their module and they may not agree with some of the hacks and never put them in. This is the community in action. I've got a fairly hefty site and I absolutely have to keep track of code mods I make, because the way I want things isn't exactly the way others do. When there's a new release, I check my document to see if I've got mods in that module and what file and function, then I do a 'diff' and re-apply my mods. The 'release notes' should tell you what mods have been applied. I'm afraid you need to learn some coding, it's a wonderful world when you 'get it'!
So onto an update for those that it may prove useful to. I've changed the codes back to 3 character codes, changed the description of some of the counties(e.g. Greater Manchester -> Manchester (Greater)) but the counties have remained as is. The ISO-3166-2:GB codes contain council areas which is not what we want, we want counties only. You'd think all the things that ISO have codes for they'd have one for counties AND one for councils, but alas no!
This code is in supported/location.uk.inc
Comment #17
YesCT CreditAttribution: YesCT commentedGood news. Ankur is cleaning up some things, going to release a new point in the version of the module, and then commit more patches. So, there is a very good chance of getting patches in, better than in a long time. Yes the maintainers are volunteers and are really busy, sometimes falling on hard times. We have a renewed opportunity now.
To get the best odds of getting some changes in:
1) download the new dev version
http://drupal.org/project/location/
2) make a patch to that (or re-roll a previous patch to match the new dev version) [and mark the issue status to needs review]
http://drupal.org/patch/create
(coding standards when making changes to code: http://drupal.org/coding-standards)
3) have at least one other person test the patch and report back here how it went [and mark the issue status to RTBC]
how to apply a patch: http://drupal.org/patch/apply
which is part of a larger "help test code" section: http://drupal.org/node/314199
to find someone to review for you, maybe contact someone that seemed interested in the issue in the past, maybe look for them on irc. http://drupal.org/irc
I'll review patches for people when I can. I'd really like to get some of these old issues cleared up too. :)
Oh, another option is to post a bounty or look for someone in #drupal-consultants and offer to pay a fee for someone to write a new patch for you... I've done that once or twice with good results for things that would have just taken me too long to figure out myself and I was in a hurry to get a solution.
Comment #18
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedMy changes in #16 as a patch against 6.x-3.x-dev (2010-Mar-29). Open for review and testing by the community.
Comment #19
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedAs part of my updating of a couple of other location.xx.inc files, in particular, Jersey, Guernsey and Isle of Man I noticed that Jersey and Guernsey were listed as counties of UK, which they aren't! they are separate countries. I've removed them from this new patch.
This patch supercedes #18 above. patched to same dev release 6.x-3.x-dev (2010-Mar-29).
Comment #20
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedGRRR. sorry folks. I applied the above patch and I kept getting a 'malformed patch'. might have just been on my system, but here's a version that patched correctly with
patch -p0 < location.uk_.inc_.patch
Comment #21
sderrick CreditAttribution: sderrick commentedI'm so glad to hear this is being fixed!
We are just starting to input our UK addresses.
http://horseschoolsonline.com/school_map
And running into huge problems.
It won't let us input Counties into the State/Province box!
And what happened to the Countries of Wales, Scotland, North Ireland?
When a working patch is ready we are ready to test!
Scott
Comment #22
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedScott,
Apply the patch in #20 and provide feedback, that's why this thread is marked as 'Needs Review'. It contains the counties for England, Scotland, Wales and NI.
Any problems, I'm glad to help.
Comment #23
eff_shaped CreditAttribution: eff_shaped commented@TechnoBuddist
Thanks so much for the response and your work on this. I know times are hard and spare time valuable.
If I have to keep those abbreviated county codes, I'd really like to have them just remain invisible to all users. So that only full county/authority names are used both in the autocomplete field and in any display. The 3 character codes are not recognised by users as normal address elements.
Is there a way of changing what the location module does with that part of the array? Can we just find a way to use the list of counties/authorities we want to, without the 'county codes'?
(I have to admit I do go into The Code sometimes (I can code html and css, and add to and edit some scripts) - and when it breaks my site, I go back and undo what I did, if my mistake is not obvious to me. I did try the mytheme_province_list_uk() in my template.php -- you are right -- no joy.)
I will attempt to look into how to apply a patch, when I get the opportunity. Then I can join in and test.
Comment #24
TechnoBuddhist CreditAttribution: TechnoBuddhist commentedOne is glad to be of service :-)
When I'm displaying an address (only with the users permission) I use this snippet in my own module;
The key is using 'province_name' and not 'province'. I only allow 1 location hence the use of $loc[0].
I don't override the 3 letter code when a user wants to change their address, so can't help you I'm afraid. It's not something that occurred to me to change, ppl don't change their county very often at all I guess that's why.
Comment #25
La M CreditAttribution: La M commentedBuckinghamshire is missing from the list of counties above.
Comment #26
La M CreditAttribution: La M commentedCan you give an example Luke where there is no street? I think that would probably only happen for very rural addresses where it was a farm or something and there was no street.
In general I think that all lines of UK addresses are optional except county and post code. Even county and the second part of the post code is optional in the case of London where you wouldn't need to add it (although the information would exist).
UK addresses are a bit of a nightmare really aren't they. I guess that's what comes of having evolutionary town planning. I think the only things that could be certain are the list of towns/cities and the list of counties.
Comment #27
La M CreditAttribution: La M commentedRe. Scotland
I see that in the list above you are including Scottish regions in with the list of counties, but they are different: Scottish counties (which they call districts) are IN Scottish regions. For example, Kincardineshire is a Scottish district and it is inside the region called Grampian region.
Or at least this is how it used to be, but a wiki article I read seemed to suggest that this two-tier system was scrapped in the 1990s and now Scotland just uses counties. (http://en.wikipedia.org/wiki/Local_government_areas_of_Scotland_1973_to_...)
I would imagine that if this is the case then the regions don't exist anymore. Either way they shouldn't be in the county list.
Regions: Strathclyde, Dumfries and Galloway, Borders, Lothian, Central, Fife, Tayside, Grampian, Highland, Western Isles, Shetland, Orkney.
Comment #28
La M CreditAttribution: La M commentedBristol is a city not a county. Bristol is in the county of Avon.
Comment #29
andybill CreditAttribution: andybill commentedjust to add info to discussion, but also a digression into addressing rather than locations, here's an explanation of how postcodes are put together .... http://www.evoxfacilities.co.uk/evoxps.htm
Point is that you'll see there is a link to a list of post towns by area (e.g.
BN Arundel, Brighton, Eastbourne, Hailsham, Hassocks, Henfield, Hove, Lancing, Lewes, Littlehampton, Newhaven, Peacehaven, Pevensey, Polegate, Seaford, Shoreham-By-Sea, Steyning, Worthing
RH Betchworth, Billingshurst, Burgess Hill, Crawley, Dorking, East Grinstead, Forest Row, Gatwick, Godstone, Haywards Heath, Horley, Horsham, Lingfield, Oxted, Pulborough, Redhill, Reigate)
The principle point to add to the discussion is that postcode areas and county boundaries do not match up and county should not be taken for granted: RH includes Godstone for example, which is in Surrey, but a lot of the RH area is West Sussex in terms of county - or, to confuse yet more, Mid-Sussex in terms of district council. I did once see an official (as in govt) letter to a business as (business name), (building name), (street), (town), Mid Sussex, West Sussex, RH15 9xy
I don't think it's sensible to attempt to fit all of the possible combinations: don't the Post Office use building name/number, address line 1, address line 2 (optional), town, country (optional), postcode?
Just in terms of addressing, when you try to cover all bases you end up with stupid things like the example that hit me yesterday: three times in a row a US website rejected a completely valid UK address for card validation, until I tried the address as
Address 1: (house address)
Address 2: (town) (bigger town nearby)
City: (city that's thirty miles away with which we share nothing other than postcode)
Country: Great Britain (let's not even get into the fact that Great Britain isn't a country, it's England or UK in our case!)
Zipcode: (postcode)
Now leaving aside the fact that I'd already set country as UK at login (so why it suggested Great Britain as a country is beyond me), this seems to be a good example of how location information does not translate - and also how certain sites (let alone card processors) can't be bothered to actually follow a discernible pattern.
Does the following work as a model address for most people on here? With the * proviso it looks ok for most of Europe, Aus/NZ, SA, US/Can; to make it work elsewhere (eg) Japan you have to be flexible in using 'street 2' as a smaller town, but really need to avoid the silliness of needing "address 2" to be !!
(house number) (street name) /alternatively, a PO Box/
/optional street 2, or suburb, or route/
* (town/city) *
/optional county/province/state/prefecture/
* /optional country/
(postcode/etc)
In the case of a site needing to print/display addresses, there should be the option of displaying the "postcode" at positions marked with * depending on the country. () things would have to be mandatory and / things optional; it'd be good to exercise some sort of control on town as a list of post towns (in a UK sense), but I'm not sure that's practical ...
anyway, sorry for digression: I just don't think it's going to be possible to come up with a definitive _and_ easy to use list of cities/counties/regions; it might be one or the other.
@La M - Kincardinshire as a county authority ceased to be in 1975, isn't it part of the Aberdeenshire council area since '96? what authority do we use for deciding whether counties that no longer have an administrative nature still exist? E.g. a former colleague used to put his address as Rutland - I don't think he ever met a computer system that would let him, but he was adamant that he lived in Rutland ...
Comment #30
YesCT CreditAttribution: YesCT commentedmarked #652736: UK county missing from list as a duplicate of this issue (but not sure if it is an "exact" duplicate, or if there is just overlap.
Comment #31
eff_shaped CreditAttribution: eff_shaped commentedHere is the list of regions I have put together (170 total). These are combined from the UK government office of national statistics.
Including:
Non-metropolitan counties (England)
Unitary Authorities (England and Wales)
Metropolitan counties (England)
Council Areas (Scotland)
District Council Areas (Norther Ireland)
Greater London (England)
Hopefully I haven't missed any.
United Kingdom: Counties and Unitary Authorities
Government areas have changed a lot in the last decade. The county of Avon, for instance, does not exist any more. Surprising to see tiny areas, like Southend-on-Sea as separate authorities, but there you go.
Getting this list to work with Location module... a whole other matter. :)
Comment #32
eff_shaped CreditAttribution: eff_shaped commentedaha! looks like Rutland is back on the map (see #31). @andybill - tell your mate!
Comment #33
Peng.Pif CreditAttribution: Peng.Pif commented#20 works good for me.
Thanks.
Comment #34
md2 CreditAttribution: md2 commented#31 Just a quick note.
"Tyrone" is missing -> http://en.wikipedia.org/wiki/County_Tyrone
Comment #35
eff_shaped CreditAttribution: eff_shaped commentedYeah, it's odd to see things like that - I think the unitary authorities are different to old counties in places. For example the English county of Avon no longer exists in the government map.
I think Tyrone is split into Strabane, Omagh, Cookstown and Dungannon as unitary authorities.
People may look for Tyrone, but will hopefully see their more specific area and choose that.
Comment #36
DanielJohnston CreditAttribution: DanielJohnston commentedSubscribing. I'll give the patch a bash. However, I'm doing mass import of addresses, and suspect that the Location approach to counties can't handle this. Most people write most counties in different ways. E.g. West Midlands can be shortened to WM or West Mids, and is often left out if something's in Birmingham, Manchester can be Manchester, Greater Manchester, but is stored here as Manchester (Greater). Forcing people to stick to an official list is good for manual input, but can't cope with imported data that shows these variations all over the place.
As a side note, I suspect the abbreviated storage for states come from the US practice of shortening all states to two letters, e.g. MI for Michigan, NY for New York and so on. Everyone in the US knows what the state codes mean as they're completely standardised.
Comment #37
DanielJohnston CreditAttribution: DanielJohnston commentedOK, I've tested the patch at #20 with a mass import of offices covering the entire UK, also locations in Jersey, Guernsey and the Isle of Man. Used Node Import but will probably try with Feeds at a later point.
About three quarters of user-inputted addresses matched to the province list and imported correctly. One quarter didn't and had to be reimported with blank province fields. This is a problem with Node Import or Location's approach to provinces generally, not this patch.
Given that Location can successfully geocode to locations in Jersey, Guernsey and the Isle of Man if they're counted as part of the UK, and that the Location setting that forces country to United Kingdom only should ideally include these three dependencies if it's to be of any use, I'm going to put them back in the province list on my server. Other than that I'd suggest this gets committed. Does this count as reviewing the patch?
Comment #38
hutch CreditAttribution: hutch commentedAttached is a patch on supported/location.uk.inc which includes Jersey, Guernsey and Isles of Scilly and is based on the patch in #20. The Isle of Man is still there. It has been made on current CVS
Although the people in those locations may regard themselves as independent, as far as geocoding goes they are part of the UK. I live in Wales and understand these annoyances very well ;-/
Comment #39
dunx CreditAttribution: dunx commentedI can't find admin/settings/location/util to clear the province cache. This just goes to the Main Settings for Location and there's no Utilities tab or anything obvious like that. I seem to have all the Location modules enabled.
Can anybody point me in the right direction?
I think this feature may be in the latest 3-dev, not 3 which I'm using.
http://drupal.org/node/363584
In the end I just deleted the provinces:uk record from the cache_location table using phpMyAdmin.
DELETE FROM `blah`.`cache_location` WHERE `cache_location`.`cid` = 'provinces:uk' LIMIT 1
Comment #40
nemchenk CreditAttribution: nemchenk commented@dunx -- I just comment out the line in location.inc (approx. line 426) which deals with the cache:
if ($cache = cache_get("provinces:$country", 'cache_location')) {
$provinces[$country] = $cache->data;
// return $provinces[$country]; // comment this out
}
The patch from #38 failed to apply against r1.7 of location.uk.inc in CVS. I'll roll a new patch and attach it...
Comment #41
nemchenk CreditAttribution: nemchenk commentedPatch against v1.7 of CVS DRUPAL-6--3
Comment #42
oglord CreditAttribution: oglord commentedThis just goes to show how pointless this field is. The real list of the 92 geographical counties (not administrative areas as most of these lists contain) is:
Comment #43
jollyroger CreditAttribution: jollyroger commentedVery good post by oglord #42. The list is an accurate list of the 92 counties but I would just like to make a couple of observations.
As far as I am aware, and I stand to be corrected, the six Northen Ireland counties are always referred to including the word County, i.e. County Antrim. I have seen them listed without but I think it is more normal and correct to include the County. This is also the case for County Durham as well. The reason for Durham is that it is the only GB county that has a city within the county with the same name. Otherwise you could end up with a postal address including Durham, Durham which would be strange (and also sounds like the Pink Panther theme!). Some of the NI counties also include city/town names as well - Antrim, Armagh and Londonderry.
Another point is that although the list is technically sound it doesn't cover the whole of the UK, at least not from a postal point of view. If you want to cover all postcode areas you would also have to add options for Isle of Man, Jersey, Guernsey, Alderney, etc and maybe even the Scilly Isles.
One last point relating to a comment elsewhere in the thread is that the county part of a UK address is NOT mandatory. The only elements required to get an item of post to the correct address is the house name/number plus the full postcode. I don't think the Post Office encourage that minimal information in case of misreading the details. They would always want the post town and street address but the county is not used. In fact the Post Office removed counties from their PAF (Postcode Address File) which is a master list of all UK addresses many years ago.
Comment #44
nemchenk CreditAttribution: nemchenk commentedThe problem with the above list, however, is that most UK residents from London will not know that it is actually in Middlesex.
This fields should help users fill in their address, not teach them about the intricacies of the UK counties!
Comment #45
hutch CreditAttribution: hutch commentedRe #42, many of the Welsh shires disappeared in the 1970's in the Local government reorganisation of that time, see
http://en.wikipedia.org/wiki/Preserved_counties_of_Wales
These are the ones that google recognises.
Comment #46
Anonymous (not verified) CreditAttribution: Anonymous commentedHutch makes a good point. Do we know which of these counties are supported by Google Maps? Surely if they aren't recognised then, when using the GMap module, the map will not render?
S
Comment #47
MrPaulDriver CreditAttribution: MrPaulDriver commentedLatest 6.x-3.x-dev release.
- location.uk.inc file is still named uk instead of gb.
Perhaps this is by design as UK is more familiar than GB, it does however install correctly.
- the county list is still incorrect and excludes Avon, Berkshire and perhaps others.
Comment #48
hutch CreditAttribution: hutch commentedI imagine that the change to GB will happen in 7.x-4.x when the countries list will (I believe) be integrated with the builtin one.
The UK counties list is full of anomalies and I have yet to find a definitive list anywhere on the web. The UK postoffice ignores them and Google seems to work on postcodes although county names do work too including obsolete ones.
The problem is that the mechanism for dealing with county/state/province names in Location module does not have a facility for aliases and I'm not sure it would be worth the hassle of implementing one.
Comment #49
gorsti CreditAttribution: gorsti commentedHi there, I am trying to make sense of what and how to patch / update.... I have an operational website, using location 6.x-3.1 and expereince the problem as outlined in this thread. However, I am needing to patch the location module, as I cannot correctly add location content to the site until I have an updated list for the state/province related to the UK. Do I use the patch from #38 or #41 or do I move to dev? Is there a timeline for a new release version to include these patches?
Thanks //G
Comment #50
imeldamayhem CreditAttribution: imeldamayhem commentedI would like to add some information on the counties issue. I understand that this can be baffling for a British citizen, let alone someone from another country!
Firstly, I feel it important to state that we NEVER use a three-character abbreviation system for our counties. As such, these abbreviations are not only non-standard, they are very unhelpful. As I use Location to give the address of a venue, I don't want it outputting what is essentially gibberish.
Likewise, it isn't very helpful if the data has been arranged alphabetically as follows:
London, City Of
As the autocomplete field searches the entire record, what is the point in this? All it does is makes addresses look weird, e.g.:
1 Fake Street
City of London, W1
becomes:
1 Fake Street
London, City of, W1
There are, indeed, several ideas of what counties we have and some that are no longer in use, along with other boundaries that are not technically counties. Most notably:
(N.B. whilst I only mentioned England, counties in Wales, at the very least, were established at the same, or similar times.)
Whilst the ceremonial counties may be the actual counties in existence today and the Post Office no longer officially use counties, the list now known as former postal counties of the United Kingdom is still in wide use. The former postal counties are recognized by Google Maps and are often still used when addressing mail. Therefore, I would recommend the use of the former postal codes.
As has been mentioned before, the Welsh counties have changed significantly in recent years. However, the formal postal counties list uses the preserved counties of Wales.
The former postal counties, along with abbreviations, are as follows:
Some notes about the above table:
Please note: accompanying the former postal counties list is usually a list of 110 special places. These towns and countries did not require a county when addressing, according to the Post Office. However, it appears they have been mistakenly added to the UK list in Location, hence people reporting towns being in the field. These places should NOT be included as counties:
The Royal Mail included this data with their Postcode Address File (PAF), the list of all addresses in the UK, until recently. Their Alias File now includes references to traditional, administrative and postal counties. As such, the former postal counties list is very much still in use.
I propose that Location should be updated to include only the counties listed in the above table in the province autocomplete field. I will attempt to create a patch for this shortly.
Here are some references to UK counties:
http://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom
http://en.wikipedia.org/wiki/Postal_counties_of_the_United_Kingdom
http://en.wikipedia.org/wiki/Counties_of_the_United_Kingdom
http://en.wikipedia.org/wiki/Administrative_county
http://www.columbia.edu/kermit/ukcounties.html
Comment #51
hutch CreditAttribution: hutch commentedThanks for your very helpful comments.
The current dev version has an option in the configuration where you can choose to display full province/state/county or the abbreviated form (which is commonly used in the US). It appears to work OK
BTW Ceredigion is missing from Wales
If you do make a patch do it on the latest development version, preferably using git. I'll be happy to help with that.
Comment #52
imeldamayhem CreditAttribution: imeldamayhem commentedThanks for your comments, hutch.
The former postal counties list uses the preserved counties of Wales list (posted by yourself in #45). Ceredigion is covered by Dyfed, as are Carmathenshire and Pembrokeshire. As such, I only went for the 8 preserved counties of Wales. Being from England, I have to say that I'm only familiar with the preserved counties, those being the ones I'm used to seeing as part of addresses.
I agree that it is hard to choose which of the counties lists to use. Whilst the current counties list may seem the answer, I think you have to consider what the Location module will be used for. By and large, it is going to be for locating (or storing) addresses. Therefore, the most logical choice is the former postal counties list, as everyone (should!) know what county to write in their own address! (This would apply both to users filling in their own addresses and using the module to enter various locations, e.g. venues - the venue's website should have the correct county on it!)
The information on the current dev version is particularly interesting - I didn't know that as I'm not currently running it. Thank you for bringing it to my attention. Whilst some countries use an abbreviated form for regions (such as the USA, as you mentioned), we don't use it here in the UK at all, and as such there's no standard for such a list. Such abbreviations could cause confusion for my visitors, so I certainly welcome the option of using full county names!
I would go into further information on how UK postcodes work and the Royal Mail's guide to correct addressing (and why the Location module does not always provide adequately for these addresses), but I feel this would be straying from the issue at hand. However, I feel it relevant to reinforce the point made that technically you could get a letter to the correct building with just the building number or name and the postcode (but not necessarily the right person, if the building is divided into units). However, for Google Maps purposes, this wouldn't work! Google Maps will accept just a postcode and give you an approximate location, or it will accept just the street line and the town. Unfortunately, there are some duplicate town names in the UK, so an address such as 1 High Street, Faketown could exist in two (or more) towns. However, adding the county will remove this confusion (and allow Google Maps to locate the address). Therefore, the county is still of importance (and best used as per addresses) - but certainly should NOT be a required field.
Comment #53
hutch CreditAttribution: hutch commentedIt's all a rather typical British muddle ;-)
Ceredigion think they are a county, see http://www.ceredigion.gov.uk
So does Pembrokeshire, http://www.pembrokeshire.gov.uk/
And http://www.carmarthenshire.gov.uk/Pages/default.aspx
Dyfed was broken up in 1996 but still exists as a Police authority.
What a mess.
The development version of Location module is quite a lot less broken than the 'stable' version, a fresh release is long overdue.
The same goes for Gmap
I take your point on multiple occurences of place names, try searching for 'Newport' so using county names does help.
The three letter code is of course a nonsense for the UK but in programming using keys is essential, if the administrative area has a name change the displayed name can change without wrecking existing records.
I hope you can come up with a better $counties array than the existing one.
Comment #54
imeldamayhem CreditAttribution: imeldamayhem commentedHaha, indeed!
Yes, Ceredigion is a county, as are Anglesey, Cardiganshire, Denbighshire, Flintshire, Monmouthshire and Pembrokeshire. However, none of them are on the preserved counties of Wales list, which is what the Post Office used for Wales (as part of the former postal counties list). There are similar issues in England (as I mentioned, Avon, Bedfordshire, Cheshire and Cleveland are no longer counties but are still on the list) and Scotland (Ross and Cromarty isn't on the list, but is partially covered by Ross-shire).
To further confound matters, there are other lists you could consider, for example the counties, boroughs, cities and other locations on the 1821 Land Tax Act:
http://www.parliament.uk/about/living-heritage/transformingsociety/priva... (and subsequent pages linked on the left)
or the current county councils:
http://en.wikipedia.org/wiki/List_of_county_councils_in_England
Although that only applies to England. You'd have to look at the unitary principal areas of Wales, too. Scotland hasn't had county councils since 1975, when they were replaced by regional councils, which were in turn replaced in 1996 by the unitary principal areas. Likewise, Northern Ireland hasn't had county councils since 1973, but they do still have district councils.
Phew!
I still say that the best system to use is the former postal counties list. However, I appreciate that there may be times where someone may prefer to go by a different list (for example, a website that listed county councils may have no need for former counties such as Avon, but may require current counties such as Ceredigion). Therefore, if time permits, I will attempt to release two (or more) patches for different circumstances. I believe it is necessary to have separate patches, as one patch containing all the possible counties could result in an undesirable result where users choose which they prefer. Say I wanted to see how many users I have in Ceredigion, or send them all a message, or have them see specific content. However, some of them have put that they're in Dyfed. That's not going to work!
Incidentally, a word on what's included in the United Kingdom:
This video actually explains it well:
http://www.youtube.com/watch?v=rNu8XDBSn10
Basically, for our purposes, the United Kingdom is England, Scotland, Wales and Northern Ireland, but not Jersey, Guernsey or the Isle of Man.
It's an exhausting issue to explain, and one I'm sure could continue to cause argument indefinitely, but it's actually quite an interesting one!
Comment #55
spessex CreditAttribution: spessex commentedsubscribing
Comment #56
Leo Pitt CreditAttribution: Leo Pitt commentedI have read most of the comments in this thread ...
I've been importing a bunch of address data to my site, and have come across this issue while wandering why Berkshire isn't in there...
In my opinion, the aim of a UK list of counties on a website is basically to enable people to enter in their address with reasonable ease whilst eliminating obvious mis-spellings and the like. As someone else said, we shouldn't be trying to correct people on the anachronisms of the UK county system.
Do I choose my county as "Bristol" or "Avon" .. ? The module should allow both in my opinion, because for all practical purposes, I don't think it makes a lot of difference. For the UK, postcode is the important bit.
So personally my ideal situation for the location UK provinces list would be to cast the net wide, rather than limit ourself to any particular provider of address data, Royal Mail or otherwise. Is there any reason not to follow this approach?
I hadn't thought of it that way ... But I have a question about your hypothetical example: if you wanted to see how many users you have in a certain location, the only reliable way to go about it would be using the postcode... So rather than frustrating the user by unnecessarily limiting their county options, wouldn't you just use the postcode (which is nearly always mandatory when gathering address data, and very reliable)?
Cheers
Comment #57
spessex CreditAttribution: spessex commentedis this ever going to be fixed out of interest as I'm still not clear what's happening? I've tried the last 6x release and it still appears to much the same. Have I missed something in the conversation how to change it from state to county etc?
Comment #58
bramley CreditAttribution: bramley commentedThis has been driving me crazy. Just subscribing for now...
Comment #59
imeldamayhem CreditAttribution: imeldamayhem commentedApologies to those awaiting a solution... I had fully intended to release a patch, but ill health meant it had to be put on the back burner. I shall endeavour to get something completed relatively soon.
Postcode searches are very reliable for the intended area, but they aren't always practical. To understand why, let's look at how a postcode is made up....
A postcode starts with a 2 to 4 character outward code. This can be split into two parts - a 1 or 2 letter postcode area and a numberical postcode district, which is a number from 0 to 99. The outward code is used to get mail from the sorting office to the correct delivery office.
The second half is the inward code. This can also be split into two parts - a single digit postal sector and a two letter postcode unit, which is usually all or part of a road, but can be a single building (e.g. a large office block). The inward code is used by the delivery office to sort mail and give it to the right postman.
We can see that it is possible to use a postcode for searching on several layers - we could look at the general area with the outward code, even to an area encompassing several towns, or we can look at the inward code and get an area within a town.
What we can't do with a postcode search is look for everyone in a particular county. As I mentioned before, I'm not really au fait with Welsh areas and postcodes, so let's look at an example in England.
Kent has the CA, ME and TN postcode areas. On top of that, parts of DA and BR are in Kent, and other parts of these two postcode areas used to be in Kent, but are now in Greater London!
Therefore, we have two choices - do 5 searches for these postcode areas (or write a custom query to cover them all... and repeat for every other county!), or search for Kent (and accept that we're going to get a few people in Bromley who still think they're in Kent, and others who aren't).
Of course, the best place to illustrate the point is London - there are lots of postcode areas in both Inner and Outer London, but technically as I said previously, it shouldn't be counted as a county! Hmm.
So yes, we're still not at a perfect solution, but it does seem that a postcode search is great for districts, boroughs and smaller areas of towns, but a town search is best for towns//villages/cities and a county search is relatively good for finding people in a particlar county.
Once I've made my county patches, I might well go further and look into a way of grouping postcodes in counties!
Comment #60
podarokall feature requests should be rolled against latest 7.x-3.x-dev and after commit can be backported to 6.x branch
Comment #62
welly CreditAttribution: welly commentedThis appears to still not have been resolved in the latest dev and RC versions so I've made a patch to resolve this using the county list above.
Comment #63
welly CreditAttribution: welly commentedForgot to update the status! Will reattach the patch and update.
Comment #64
podarok#63 commited pushed to 7.x-3.x
Thanks!
This patch has to be ported to 6.x-3.x
Comment #65
welly CreditAttribution: welly commentedCheers! I shall try and find time this week to port it to 6.x-3.x.
Comment #66
legolasboClosing old D6 issues as D6 is end of life