uk_bin_collection 0.144.2__py3-none-any.whl → 0.144.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uk_bin_collection/Local_Authority_Boundaries.geojson +1 -0
- uk_bin_collection/map.html +108 -0
- uk_bin_collection/tests/input.json +613 -303
- uk_bin_collection/uk_bin_collection/councils/BristolCityCouncil.py +4 -1
- uk_bin_collection/uk_bin_collection/councils/Hillingdon.py +273 -0
- {uk_bin_collection-0.144.2.dist-info → uk_bin_collection-0.144.4.dist-info}/METADATA +1 -1
- {uk_bin_collection-0.144.2.dist-info → uk_bin_collection-0.144.4.dist-info}/RECORD +10 -8
- uk_bin_collection/uk_bin_collection/councils/HounslowCouncil.py +0 -122
- {uk_bin_collection-0.144.2.dist-info → uk_bin_collection-0.144.4.dist-info}/LICENSE +0 -0
- {uk_bin_collection-0.144.2.dist-info → uk_bin_collection-0.144.4.dist-info}/WHEEL +0 -0
- {uk_bin_collection-0.144.2.dist-info → uk_bin_collection-0.144.4.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,108 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8" />
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
+
<title>UK Council Coverage Map</title>
|
8
|
+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
9
|
+
<style>
|
10
|
+
#map {
|
11
|
+
height: 100vh;
|
12
|
+
}
|
13
|
+
</style>
|
14
|
+
</head>
|
15
|
+
|
16
|
+
<body>
|
17
|
+
<div id="map"></div>
|
18
|
+
|
19
|
+
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
20
|
+
<script>
|
21
|
+
const map = L.map('map').setView([54.5, -2.7], 6); // Centered on UK
|
22
|
+
|
23
|
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
24
|
+
attribution: '© OpenStreetMap contributors'
|
25
|
+
}).addTo(map);
|
26
|
+
|
27
|
+
// Helper to slugify wiki anchor
|
28
|
+
function slugify(str) {
|
29
|
+
return str.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
|
30
|
+
}
|
31
|
+
|
32
|
+
fetch('tests/input.json')
|
33
|
+
.then(res => res.json())
|
34
|
+
.then(integrationData => {
|
35
|
+
console.log("🔍 Loaded integration data:", integrationData);
|
36
|
+
|
37
|
+
const coveredLADs = new Set();
|
38
|
+
const integrationByLAD24CD = {};
|
39
|
+
|
40
|
+
for (const entry of Object.values(integrationData)) {
|
41
|
+
const rawCode = entry.LAD24CD;
|
42
|
+
const code = rawCode?.replace(/[^\x20-\x7E]/g, '').trim(); // Sanitize non-printables
|
43
|
+
if (code) {
|
44
|
+
console.log(`✅ Adding LAD24CD: [${code}] from raw: [${rawCode}]`);
|
45
|
+
coveredLADs.add(code);
|
46
|
+
integrationByLAD24CD[code] = {
|
47
|
+
wiki_name: entry.wiki_name || "Unknown Council",
|
48
|
+
url: `https://github.com/robbrad/UKBinCollectionData/wiki/Councils#${slugify(entry.wiki_name || "unknown-council")}`
|
49
|
+
};
|
50
|
+
} else {
|
51
|
+
console.warn("⚠️ Entry with missing or bad LAD24CD:", entry);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
console.log("🧪 Contains E06000065?", coveredLADs.has("E06000065"));
|
56
|
+
console.log("📦 Final set of covered LADs:", [...coveredLADs]);
|
57
|
+
|
58
|
+
return fetch('Local_Authority_Boundaries.geojson')
|
59
|
+
.then(res => res.json())
|
60
|
+
.then(geojson => {
|
61
|
+
L.geoJSON(geojson, {
|
62
|
+
style: feature => {
|
63
|
+
const code = feature.properties.LAD24CD?.trim();
|
64
|
+
const isCovered = coveredLADs.has(code);
|
65
|
+
return {
|
66
|
+
color: '#333',
|
67
|
+
weight: 1,
|
68
|
+
fillColor: isCovered ? 'green' : 'red',
|
69
|
+
fillOpacity: 0.6
|
70
|
+
};
|
71
|
+
},
|
72
|
+
onEachFeature: (feature, layer) => {
|
73
|
+
const code = feature.properties.LAD24CD?.trim();
|
74
|
+
const name = feature.properties.LAD24NM;
|
75
|
+
const covered = coveredLADs.has(code);
|
76
|
+
|
77
|
+
console.log("🌍 GeoJSON Feature:", code, name);
|
78
|
+
if (!code) console.warn("⚠️ Missing LAD24CD in GeoJSON feature:", feature);
|
79
|
+
if (!covered && code) console.warn("❌ Not covered LAD:", code, name);
|
80
|
+
|
81
|
+
if (covered && integrationByLAD24CD[code]) {
|
82
|
+
const wiki = integrationByLAD24CD[code];
|
83
|
+
layer.bindPopup(
|
84
|
+
`<strong>${name}</strong><br>Status: ✅ Covered<br>` +
|
85
|
+
`<a href="${wiki.url}" target="_blank">📘 ${wiki.wiki_name}</a>`
|
86
|
+
);
|
87
|
+
} else {
|
88
|
+
layer.bindPopup(`<strong>${name}</strong><br>Status: ❌ Not Covered`);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}).addTo(map);
|
92
|
+
|
93
|
+
// ✅ 🔍 Missing LADs debug block
|
94
|
+
const missing = [];
|
95
|
+
geojson.features.forEach(f => {
|
96
|
+
const code = f.properties.LAD24CD?.trim();
|
97
|
+
if (!coveredLADs.has(code)) {
|
98
|
+
missing.push(`${code} - ${f.properties.LAD24NM}`);
|
99
|
+
}
|
100
|
+
});
|
101
|
+
console.warn("🛠️ Missing LADs in input.json:", missing);
|
102
|
+
});
|
103
|
+
})
|
104
|
+
.catch(err => console.error('❌ Error loading data:', err));
|
105
|
+
</script>
|
106
|
+
</body>
|
107
|
+
|
108
|
+
</html>
|