Skip to content

Commit

Permalink
Merge pull request #445 from rcpch:revert-geojson-api-call
Browse files Browse the repository at this point in the history
updates map call without geojson
  • Loading branch information
eatyourpeas authored Dec 21, 2024
2 parents e60cce1 + 109c41a commit 8091243
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions project/npda/general_functions/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def generate_distance_from_organisation_scatterplot_figure(
welsh_gdf = gpd.GeoDataFrame.from_file(welsh_file_path)
english_gdf = gpd.GeoDataFrame.from_file(english_file_path)

print(english_gdf.columns)
english_gdf.set_geometry("geometry")

# Get all the Local Authorities in a 10km radius of the paediatric_diabetes_unit
local_authority_districts = fetch_local_authorities_within_radius(
Expand All @@ -163,9 +163,7 @@ def generate_distance_from_organisation_scatterplot_figure(
radius=10000, # 10km
)
# store the Local Authority District identifiers in a list
filtered_values = [
lad["properties"]["lad24cd"] for lad in local_authority_districts
]
filtered_values = [lad["lad24cd"] for lad in local_authority_districts]

# from the english gdf remove all LSOAs that are not in the local authority district list
if "Local Authority District code (2019)" in english_gdf:
Expand Down
2 changes: 1 addition & 1 deletion project/npda/general_functions/rcpch_nhs_organisations.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ def fetch_local_authorities_within_radius(
response = requests.get(request_url, headers=headers, timeout=10)
response.raise_for_status()

return response.json()["features"]
return response.json()

0 comments on commit 8091243

Please sign in to comment.