Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add region and country to geo lookups #71

Closed
drkane opened this issue Feb 2, 2021 · 5 comments
Closed

Add region and country to geo lookups #71

drkane opened this issue Feb 2, 2021 · 5 comments

Comments

@drkane
Copy link
Contributor

drkane commented Feb 2, 2021

At the moment a geocode in recipient or beneficiary location is ignored if it's a country or a region. These should be added as GeoLookup objects so that they can be included in the data.

The example given was WCVA who publish grants with a geocode of W92000004 - eg https://grantnav.threesixtygiving.org/grant/360G-WCVA-27082

The data would need to be added to https://github.com/ThreeSixtyGiving/datastore/blob/master/datastore/additional_data/sources/geo_lookup.py

@michaelwood
Copy link
Member

@drkane
Copy link
Contributor Author

drkane commented Jul 14, 2021

Fixing this partly depends on these codes being available in https://github.com/drkane/geo-lookups/ (or similar format) - I've now updated this so there are files for region, country and combined authority. So it should just be a case of adding the files to

SOURCE_URLS = {
"lsoa": {
"url_lookup": "https://raw.githubusercontent.com/drkane/geo-lookups/master/lsoa_la.csv",
"url_latlong": "https://raw.githubusercontent.com/drkane/geo-lookups/master/lsoa_latlong.csv",
"field_areacode": "lsoa11cd",
"field_areaname": "lsoa11nm",
"field_transforms": {
"lad20cd": "ladcd",
"lad20nm": "ladnm",
},
},
"msoa": {
"url_lookup": "https://raw.githubusercontent.com/drkane/geo-lookups/master/msoa_la.csv",
"url_latlong": "https://raw.githubusercontent.com/drkane/geo-lookups/master/msoa_latlong.csv",
"field_areacode": "msoa11cd",
"field_areaname": "msoa11hclnm",
"field_transforms": {
"lad20cd": "ladcd",
"lad20nm": "ladnm",
},
},
"ward": {
"url_lookup": "https://raw.githubusercontent.com/drkane/geo-lookups/master/ward_all_codes.csv",
"url_latlong": "https://raw.githubusercontent.com/drkane/geo-lookups/master/ward_latlong.csv",
"field_areacode": "wdcd",
"field_areaname": "wdnm",
},
"la": {
"url_lookup": "https://raw.githubusercontent.com/drkane/geo-lookups/master/la_all_codes.csv",
"field_areacode": "ladcd",
"field_areaname": "ladnm",
"field_transforms": {
"lad20cd": "ladcd",
"lad20nm": "ladnm",
},
},
}

@drkane
Copy link
Contributor Author

drkane commented Aug 4, 2021

I've now added equivalent files for regions and countries to the geo-lookups repository, so it should be straightforward to add these to the SOURCE_URLS dictionary.

We should also include the Upper tier local authorities and Combined Authority files here too.

@michaelwood
Copy link
Member

I've now added equivalent files for regions and countries to the geo-lookups repository, so it should be straightforward to add these to the SOURCE_URLS dictionary.

We should also include the Upper tier local authorities and Combined Authority files here too.

@drkane do you have preferences on what field names should be called? or should we just use rgn ctry utla and cuath ?

@drkane
Copy link
Contributor Author

drkane commented Nov 5, 2021

should we just use rgn ctry utla and cuath ?

Those work for me!

BibianaC added a commit that referenced this issue Nov 5, 2021
…ries, upper tier local authorities and combined authority.

#71
michaelwood added a commit that referenced this issue Nov 10, 2021
Adds data sources for regions, countries, upper tier local authorities and
combined authority.

Fixes #71

Co-authored-by: Michael Wood <michael.wood@opendataservices.coop>
michaelwood added a commit that referenced this issue Nov 10, 2021
Adds data sources for regions, countries, upper tier local authorities and
combined authority.

Fixes #71

Co-authored-by: Michael Wood <michael.wood@opendataservices.coop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants