Closed digitalWestie closed 5 years ago
Objective is an array of boundary data matches:
[{'code-type':'local_authority', 'code':'S12000046', 'name': 'Glasgow City' }, {{'code-type':'health_board', 'code':'S08000021', 'name': 'Glasgow Area } ]
Geo Data for Scottish Local Authorities:
The ultimate goal of the feature is:
search.py
and add tests to ensure it's working correctly.To do:
Required methods:
data_set
, data_set_keys
, and lat-long
) and returns match objects i.e. {'code-type':'local_authority', 'code':'S12000046', 'name': 'Glasgow City' }
.Download QGIS version=3.4.8 and try to process the Health Board boundary data and convert into the correct format.
Health Integration Authorities (HSCP):
Now a long_lat can be passed in as an argument to check_boundaries
and an object of all matching boundaries is returned.
Refactor the boundary_mappings as dictionaries and remove the unnecessary repetition of long_lat
Merge into master
In the following folder there's ruby code for determining the local authority a set of coordinates are found in:
https://github.com/openactive/api-dashboard/tree/master/lib/local_geocoder
It uses a ruby library called 'local-geocoder' which provides a geometry class with a
contains_point?
method.The goal here would be to write equivalent version, but in python. It's possible someone has done this before so first step is to research code elsewhere.
This above example is fixed to UK local authorities, whereas we want to work to something a bit more abstract if possible.
Edit- it looks like the
shapely
library is the one we're after:https://stackoverflow.com/questions/20776205/point-in-polygon-with-geojson-in-python