cyipt / actdev

ActDev - Active travel provision and potential in planned and proposed development sites
https://actdev.cyipt.bike
7 stars 3 forks source link

Programmatically add main local authority to all-sites.geojson #165

Closed natesheehan closed 3 years ago

natesheehan commented 3 years ago

main_local_authority is currently manually to the all-sites.geojson. We should change this so it happens programmatically.

For England and Wales, we could query this https://geoportal.statistics.gov.uk/datasets/3ba3daf9278f47daba0f561889c3521a_0 or does this data come from pctor stplanr @Robinlovelace ?

Robinlovelace commented 3 years ago

Good question... I suggest adding a minimal geojson file with UK LAs into the package. I'm not sure at what level planning takes place (any ideas @joeytalbot ?) but as a starter for 10 I think this is the way forward: https://geoportal.statistics.gov.uk/search?q=local%20authority%20boundaries&sort=-modified

Robinlovelace commented 3 years ago

This is a good place to start: https://github.com/cyipt/popupCycleways/blob/master/pct_la_summaries.geojson

joeytalbot commented 3 years ago

It's generally the lower tier authorities, e.g. https://geoportal.statistics.gov.uk/datasets/local-authority-districts-april-2019-uk-bgc?geometry=-30.537%2C51.101%2C25.669%2C59.782

natesheehan commented 3 years ago

Thanks @joeytalbot & @Robinlovelace . I'll self-assign this issue.

Apart from adding the main local authorities programmatically to the all-sites.geojson file, do we want to create any monitoring (csv, db, json) for LA's in general. e.g. devon-sites.geojson?

Robinlovelace commented 3 years ago

Thanks @natesheehan !

Regarding your question

Apart from adding the main local authorities programmatically to the all-sites.geojson file, do we want to create any monitoring (csv, db, json) for LA's in general. e.g. devon-sites.geojson?

No I think just updating the all-sites.geojson is enough, wanting to keep the number of files/moving parts to a minimum at this stage. We could add additional fields to that file but that's a low priority.

joeytalbot commented 3 years ago

Thanks @natesheehan let me know if you have any trouble with the LA geographies, there's quite a complex set of different types of local authority, and they also keep on changing.

natesheehan commented 3 years ago

@joeytalbot I have created a PR https://github.com/cyipt/actdev/pull/170 using the new method. The implemented method uses this data:

It's generally the lower tier authorities, e.g. https://geoportal.statistics.gov.uk/datasets/local-authority-districts-april-2019-uk-bgc?geometry=-30.537%2C51.101%2C25.669%2C59.782

and the sf::sf_intersection in order to find the LA name. Let me know if everything looks as it should!

natesheehan commented 3 years ago

New sites and existing sites now include programmatically generated main_local_authority

Robinlovelace commented 3 years ago

Great work Nathanael :fire:

joeytalbot commented 3 years ago

This looks great!