Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Visualising school catchment areas - FOSS4GUK 2018

259 views

Published on

FOSS4G UK 2018 talk on different visualisations examples using school and pupil datasets. with open source software including PostgreSQL, PostGIS, QGIS, pgRouting.

Published in: Data & Analytics
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Visualising school catchment areas - FOSS4GUK 2018

  1. 1. Visualising school catchment areas Ross McDonald @mixedbredie & Roger Garbett @reagarbett Angus Council
  2. 2. Sec. catchment areas
  3. 3. Sec. catchment areas + Schools
  4. 4. Sec. catchment areas + Schools + Pupils
  5. 5. All catchment areas
  6. 6. All catchment areas + Schools
  7. 7. All catchment areas + Schools + Pupils
  8. 8. #cartofail
  9. 9. Jackson Pollock – Convergence (1952)
  10. 10. School Name In Catchment On roll Arbroath Academy 723 640 Arbroath 790 858 Brechin 490 470 Carnoustie 720 732 Forfar Academy 1264 971 Monifieth 600 898 Montrose Academy 781 810 Webster’s 584 665
  11. 11. Convex hulls around points
  12. 12. How similar are the hulls v catchments? School Hausdorff Distance Arbroath Academy 10786.11436 Carnoustie High School 12089.85805 Forfar Academy 14875.58697 Brechin High School 16173.88699 Webster's High School 17435.49058 Arbroath High School 17897.3712 Monifieth High School 19965.69684 Montrose Academy 26048.84715 Monifieth High School 26559.60197 Monifieth High School 29441.0212 Monifieth High School 32072.78722 Forfar Academy 33494.96229 Forfar Academy 34145.29587 Webster's High School 41377.54145 ST_HausdorffDistance
  13. 13. School Hausdorff Distance Timmergreens_Primary_School 1731.781666 Inverkeilor_Primary_School 2126.061069 Auchterhouse_Primary_School 2255.042931 Strathmartine_Primary_School 2692.634275 Arbirlot_Primary_School 3031.15279 Newbigging_Primary_School 3374.436552 Colliston_Primary_School 3382.872103 Inverarity_Primary_School 3671.3657 Eassie_Primary_School 4083.874877 Mattocks_Primary_School 4838.524264 Murroes_Primary_School 4944.509153 Carmyllie_Primary_School 5366.863652 Monikie_Primary_School 5605.587575 Edzell_Primary_School 5689.958939 Newtyle_Primary_School 6718.80455 Tealing_Primary_School 7054.552578 Rosemount_Primary_School 7104.241394 Stracathro_Primary_School 7737.626576 Maisondieu_Primary_School 7864.206572 Glamis_Primary_School 7897.602526 Friockheim_Primary_School 8188.045971 Muirfield_Primary_School 8248.403932 Warddykes_Primary_School 9139.01384 Borrowfield_Primary_School 9981.867569 Northmuir_Primary_School 10772.74056 Birkhill_Primary_School 11083.09715 Airlie_Primary_School 11322.43266 Tarfside_Primary_School 12599.0575 Liff_Primary_School 12607.8253 Strathmore_Primary_School 12656.01378 Aberlemno_Primary_School 12760.94431 Woodlands_Primary_School 13369.26143 Seaview_Primary_School 14594.95696 Isla_Primary_School 14998.10042 Whitehills_Primary_School 15976.5553 Cortachy_Primary_School 17253.12438 Andover_Primary_School 17681.72081 Inverbrothock_Primary_School 18383.85489 Burnside_Primary_School 18474.65586 Tannadice_Primary_School 19066.29543 Ferryden_Primary_School 19193.80757 Hayshead_Primary_School 19762.61945 Lochside_Primary_School 20013.20366 Grange_Primary_School 20923.14925 Southmuir_Primary_School 22114.15467 Carlogie_Primary_School 23437.45404 Langlands_Primary_School 25800.66565 Southesk_Primary_School 26626.14889 Ladyloan_Primary_School 53008.81887 Lochside Primary School 20013.20366 Grange Primary School 20923.14925 Southmuir Primary School 22114.15467 Carlogie Primary School 23437.45404 Langlands Primary School 25800.66565 Southesk Primary School 26626.14889 Ladyloan Primary School 53008.81887
  14. 14. QGIS geometry generators Straight lines between points: make_line( make_point("p_easting", "p_northing"), make_point("s_easting", "s_northing") )
  15. 15. QGIS geometry generators Kinked line between points: make_line( make_point("p_easting", "p_northing"), make_point(abs("p_easting" - "s_easting")/2 + "p_easting", abs("p_northing" - "s_northing")/2 + "p_northing" ), make_point("s_easting", "s_northing"))
  16. 16. QGIS geometry generators Smoothed line between points: smooth( make_line( make_point("p_easting","p_northing"), make_point(abs("p_easting"-"s_easting")/2+ "p_easting", abs("p_northing"-"s_northing")/2 + "p_northing"), make_point("s_easting","s_northing")), iterations:=4, offset:=0.25)
  17. 17. PostGIS circularstrings CREATE OR REPLACE VIEW public.view_curvelinks AS SELECT foo.p_id, foo.s_uprn, st_setsrid(st_curvetoline(st_geomfromtext(((((((((((('CIRCULARSTRING('::text || st_x(foo.start_point)) || ' '::text) || st_y(foo.start_point)) || ','::text) || (st_x(foo.middle_point) + foo.distance * cos(foo.azimuth))) || ' '::text) || (st_y(foo.middle_point) + foo.distance * sin(foo.azimuth))) || ','::text) || st_x(foo.end_point)) || ' '::text) || st_y(foo.end_point)) || ')'::text)), 27700) AS the_geom FROM ( SELECT pupils_2018.p_id, pupils_2018.s_uprn, st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision) AS start_point, st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision) AS end_point, st_lineinterpolatepoint(st_makeline(st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision), st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision)), 0.5::double precision) AS middle_point, pi() / 2::double precision + st_azimuth(st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision), st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision)) AS azimuth, 0.25::double precision * st_distance(st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision), st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision)) AS distance FROM pupils_2018) foo; st_setsrid(st_curvetoline(st_geo mfromtext('CIRCULARSTRING(x0 y0, x1 y1, x2 y2))),27700)
  18. 18. PostGIS 3D circularstrings CREATE OR REPLACE VIEW public.view_curvelinks_3d AS SELECT foo.p_id, foo.s_uprn, st_setsrid(st_curvetoline(st_geomfromtext(((((((((((((((((('CIRCULARSTRING('::text || st_x(foo.start_point)) || ' '::text) || st_y(foo.start_point)) || ' '::text) || 0) || ','::text) || st_x(foo.middle_point)) || ' '::text) || st_y(foo.middle_point)) || ' '::text) || (foo.distance / 2::double precision)) || ','::text) || st_x(foo.end_point)) || ' '::text) || st_y(foo.end_point)) || ' '::text) || 0) || ')'::text)), 27700) AS the_geom FROM ( SELECT pupils_2018.p_id, pupils_2018.s_uprn, st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision) AS start_point, st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision) AS end_point, st_lineinterpolatepoint(st_makeline(st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision), st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision)), 0.5::double precision) AS middle_point, pi() / 2::double precision + st_azimuth(st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision), st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision)) AS azimuth, 0.25::double precision * st_distance(st_makepoint(pupils_2018.p_easting::double precision, pupils_2018.p_northing::double precision), st_makepoint(pupils_2018.s_easting::double precision, pupils_2018.s_northing::double precision)) AS distance FROM pupils_2018) foo; st_setsrid(st_curvetoline(st_geo mfromtext('CIRCULARSTRING(x0 y0 z0, x1 y1 z1, x2 y2 z2))),27700)
  19. 19. Sec. catchment areas with arcs
  20. 20. Webster’s High School detail
  21. 21. 3D arcs in QGIS2ThreeJS (sec. schools)
  22. 22. 3D splines in Blender (sec. schools)
  23. 23. 3D splines in Blender (pri. schools)
  24. 24. What about routes to schools?
  25. 25. The situation • 15,885 children traveling to and from school every day • Some travelling more than 30 minutes each way • Fragmented catchment areas • Sub-optimal distribution of children (or was it schools?)
  26. 26. OS MasterMap Highways Network layer
  27. 27. Highways Network • Topological link and node network • Classifications • One ways and no entries • Turn, height, weight, width restrictions • Supplied as GML • Geometry and attributes loaded into PostGIS with FME
  28. 28. CREATE EXTENSION pgrouting;
  29. 29. Routable network in QGIS with plugin
  30. 30. Astar shortest path from home to school
  31. 31. Batch process the whole network
  32. 32. 20 minute driving distance from school
  33. 33. ST_VoronoiPolygons (PostGIS 2.3.x +)
  34. 34. Use the database, Luke! • 24k nodes = 24k Voronoi polygons • QGIS ~ 4 hours • PostGIS ~ 5 minutes • 15,885 pupils, 57 schools • Turn Restricted Shortest Path (with RRI) • PostGIS ~ 2 hours
  35. 35. Identifying pupils with long journey times
  36. 36. Identifying pupils with long journey times
  37. 37. 15 – 30 minute travel time
  38. 38. 20 – 40 minute travel time
  39. 39. 10 minutes from school
  40. 40. 10 – 20 minute travel time
  41. 41. Fastest routes, shortest path
  42. 42. Fastest routes, shortest path
  43. 43. 1 hour travel
  44. 44. 1 hour to school
  45. 45. The tools • PostgreSQL database with PostGIS and pgRouting super powers for routing • QGIS Time Manager for image sequences • Avidemux for animation sequences • FFmpeg for conversions • QGIS2ThreeJS for interactive 3D models • Blender for 3D visualisations
  46. 46. The results 15,885 daily journeys to school 43,700km travelled each day 1450 hours of daily travel time 200+ children with > 1hr daily travel The results from the results We’ll have to wait and see.
  47. 47. Grateful thanks • QGIS PSC and devs for awesomeness packaged • Twitter #GISTribe and pgRouting mailing lists • Owen Powell and Craig Taylor for Blender tips and inspiration • Roger, for writing an address geocoder
  48. 48. Are we there yet? mcdonaldr@angus.gov.uk @mixedbredie garbettrea@angus.gov.uk @reagarbett Next QGIS UK User Group (Scotland) Oct/Nov 2018 http://qgis.uk/ All spider images CC BY-NC pngimg.com

×