diff --git a/README.md b/README.md index a3a66ad..457d0b9 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,9 @@ See [Configuration Reference](https://cli.vuejs.org/config/). ### Walking distances Schools with `"measure": "walk"` in `src/plugins/schools.js` are judged on walking distance rather than a straight line. -Their walking data is built from GraphHopper isochrones and saved to `public/data/walk/`, so a visitor's address never -leaves their browser. +The walk from a visitor's home is looked up with Google Maps walking directions (Distance Matrix, using the same Maps +key) when they set an address. The walking *areas* drawn on the map are built from GraphHopper isochrones and saved to +`public/data/walk/`; until those exist the hand-drawn `intakePath` outlines are used. ``` GRAPHHOPPER_API_KEY=... node scripts/walking-bands.mjs # only files whose inputs changed diff --git a/src/App.vue b/src/App.vue index baf2c9a..5116a7f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -28,7 +28,7 @@
{{ finePrint }}
- {{ sourceLine }} Issues: matt@roxburghm.com + {{ sourceLine }} Questions or corrections: matt@roxburghm.com · Build {{ buildDateTime }}
@@ -115,7 +115,7 @@{{ finePrint }}
- {{ sourceLine }} Issues: matt@roxburghm.com + {{ sourceLine }} Questions or corrections: matt@roxburghm.com · Build {{ buildDateTime }}
@@ -256,6 +256,12 @@ export default { // storage unavailable – keep the in-memory value } }, + fetchWalks() { + if (!this.home) return; + const walkSchools = this.schools.filter(s => admission.measure(s) === 'walk'); + walkSchools.forEach(walking.load); + if (this.mapsReady) walking.lookupWalks(walkSchools, this.home); + }, matchesName(school) { const query = this.nameFilter.trim().toLowerCase(); return !query || school.name.toLowerCase().includes(query) || school.shortName.toLowerCase().includes(query); @@ -361,13 +367,13 @@ export default { return this.home ? `Your chances from ${this.homeName}` : 'Schools'; }, finePrint() { - return `Mini charts: each bar is the furthest distance offered in a year, ${YEARS[0]}–${YEARS[YEARS.length - 1]}. ` + - 'The orange line is your home. Pale full-height bars mean everyone who applied got a place. ' + - 'Distances are straight-line unless noted. Check each school’s admission rules before you apply.'; + return `Each mini chart shows the furthest distance offered each year, ${YEARS[0]}–${YEARS[YEARS.length - 1]}, ` + + 'with your home as the orange line. Pale full-height bars mean everyone who applied got a place. ' + + 'Distances are straight-line unless a school notes otherwise.'; }, sourceLine() { - return `Source: Ealing Council “Starting High School” booklets and on-time offer reports, ${YEARS[0]}–${YEARS[YEARS.length - 1]}. ` + - 'Ofsted and GCSE figures from GOV.UK. Past distances don’t guarantee future offers. Use at your own risk.'; + return `Figures come from Ealing Council’s offer reports and booklets, ${YEARS[0]}–${YEARS[YEARS.length - 1]}, ` + + 'and from GOV.UK. They’re estimates to help you plan; Ealing Council makes the admissions decisions.'; }, // The schools plus about 2 km either side, to steer address suggestions towards Ealing. searchArea() { @@ -385,13 +391,17 @@ export default { }, }, watch: { - // Walking bands are only needed once there's a home to measure from. + // Walking data is only needed once there's a home to measure from: the + // walk itself from Google (once its script has loaded), outlines from CI. home: { immediate: true, - handler(home) { - if (home) this.schools.filter(s => admission.measure(s) === 'walk').forEach(walking.load); + handler() { + this.fetchWalks(); } }, + mapsReady() { + this.fetchWalks(); + }, rankedRows(rows) { if (!this.selected && rows.length) this.selected = rows[0].school; }, diff --git a/src/Help.vue b/src/Help.vue index 1843ada..aa08c0e 100644 --- a/src/Help.vue +++ b/src/Help.vue @@ -37,9 +37,9 @@ walking distance along pavements, so its area follows the street network rather than a circle.- Walking distances are worked out in advance from OpenStreetMap data using GraphHopper, then looked up on your - device. They're estimates: the council uses its own address points and routes. Results near the line are - marked too close to call. + Your walking distance comes from Google Maps walking directions to the school. It's an estimate: the + council uses its own address points and routes, so results within about 50 metres of the line are marked + too close to call.
@@ -64,7 +64,7 @@Exam results from the Department for Education. Ofsted grades from reports.ofsted.gov.uk. - Walking routes © OpenStreetMap contributors, + Walking distances from Google Maps. Walking areas on the map © OpenStreetMap contributors, calculated with GraphHopper.
@@ -73,12 +73,14 @@Your address is saved only in this browser so it's there next time. Google sees what you type in the address - box to suggest matches. Nothing else is sent anywhere. + box to suggest matches, and the location you pick, to work out walking distances to schools that use them. + Nothing is sent anywhere else.
- Figures are approximate and for guidance only. Problems or corrections: + Every figure here is an estimate, for guidance only. Ealing Council’s admissions decisions are final. + Problems or corrections: matt@roxburghm.com
diff --git a/src/components/IntakeChart.vue b/src/components/IntakeChart.vue index bd171d0..f3afdc6 100644 --- a/src/components/IntakeChart.vue +++ b/src/components/IntakeChart.vue @@ -25,7 +25,7 @@ :rx="compact ? 1 : 3" :fill="`url(#${patternId})`" class="all-bar"/> -{{ yearLine }}
++ + Estimates only. These figures are worked out from past offers and our own distance + measurements. Ealing Council’s admissions decisions are final. +
+Note: {{ school.notes }}