Top Banner
Matthew Baker Denver Public Schools The Spatial Database Lessons from the Enterprise...and PostGIS
48

2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Feb 11, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Matthew BakerDenver Public Schools

The Spatial DatabaseLessons from the Enterprise...and PostGIS

Page 2: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 3: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 4: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

--View for "reverse" scatterplot--

create view Oct14ScatterES as (Select cast(row_number() over(order by O.ressch asc) as int) as OBJECTID,cast(O.ResSch as int) as ResSch,O.SchNum,O.Students,sch.ABBREVIATION,sch.shapefrom (select oct.RESSCH as ResSch,oct.schNum as SchNum,count(oct.STUDENTNUMBER) as Students FROM [dpsdata].[OctoberCount_Archive] as Oct where oct.RESSCH <> '0' and oct.adjGradeCrd in ('EC','00', '01', '02', '03', '04', '05') and oct.Year = '2014' group by ressch, schNum) as O join [dpsdata].[Schools_Current] as sch on sch.SCHNUM = O.SchNum)

Page 5: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 6: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

SELECT fz.GEOID_BG , fz.SBRegion , count (case when oct.year = '2009' then 1 end) as [2009] , count (case when oct.Year = '2010' then 1 end) as [2010] , count (case when oct.Year = '2011' then 1 end) as [2011] , count (case when oct.Year = '2012' then 1 end) as [2012] , count (case when oct.Year = '2013' then 1 end) as [2013] , count (case when oct.Year = '2014' then 1 end) as [2014] FROM [dpsdata].[OctoberCount_Archive] as oct join dpsdata.ForecastZones as fz on oct.shape.STIntersects(fz.shape) = 1 where oct.Year >= '2009' and oct.langbkgrd in ('spa', '1380')

group by fz.GEOID_BG, fz.SBRegion

Page 7: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Student Enterprise GIS

Page 8: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 9: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 10: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 11: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

ArcSDE

42 Tables

Page 12: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

ArcSDE Back End (SQL Server) > 100 'SDE' Tables

Versioning

- adds 3 more tables per versioned feature class

Page 13: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 14: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 15: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 16: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 17: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 18: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 19: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 20: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 21: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 22: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 23: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Spatial isn't special.*

Page 24: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Matthew BakerDenver Public Schools

@mapBaker

[email protected]

Thank you!

Page 25: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Matthew BakerDenver Public Schools

The Spatial DatabaseLessons from the Enterprise...and PostGIS

Matthew Baker is the SR. GIS Analyst at Denver Public Schools

Page 26: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 27: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 28: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

--View for "reverse" scatterplot--

create view Oct14ScatterES as (Select cast(row_number() over(order by O.ressch asc) as int) as OBJECTID,cast(O.ResSch as int) as ResSch,O.SchNum,O.Students,sch.ABBREVIATION,sch.shapefrom (select oct.RESSCH as ResSch,oct.schNum as SchNum,count(oct.STUDENTNUMBER) as Students FROM [dpsdata].[OctoberCount_Archive] as Oct where oct.RESSCH <> '0' and oct.adjGradeCrd in ('EC','00', '01', '02', '03', '04', '05') and oct.Year = '2014' group by ressch, schNum) as O join [dpsdata].[Schools_Current] as sch on sch.SCHNUM = O.SchNum)

Page 29: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 30: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

SELECT fz.GEOID_BG , fz.SBRegion , count (case when oct.year = '2009' then 1 end) as [2009] , count (case when oct.Year = '2010' then 1 end) as [2010] , count (case when oct.Year = '2011' then 1 end) as [2011] , count (case when oct.Year = '2012' then 1 end) as [2012] , count (case when oct.Year = '2013' then 1 end) as [2013] , count (case when oct.Year = '2014' then 1 end) as [2014] FROM [dpsdata].[OctoberCount_Archive] as oct join dpsdata.ForecastZones as fz on oct.shape.STIntersects(fz.shape) = 1 where oct.Year >= '2009' and oct.langbkgrd in ('spa', '1380')

group by fz.GEOID_BG, fz.SBRegion

Page 31: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Student Enterprise GIS

Page 32: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 33: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 34: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

More details regarding this report-The user can select a distance bandThe user also selects whether or not to include students with multiple address or- only show

students with multiple addressesThe screenshot below shows students with addresses in the 5.1-10 mile band AND their

secondary addresses in other bands.   These are shown in yellow.  The rest of the school population is in green.

What you don’t see- a grid of all the students fitting the conditions selected in the dropdown.  The grid provides additional information such as address, attendance, exact distance.  It could also include behavior, etc.  That data is available on the map with a ‘hover’ so that you can use the mouse to ‘hover’ over a dot and get all the information about that student.

Page 35: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

ArcSDE

42 Tables

Page 36: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

ArcSDE Back End (SQL Server) > 100 'SDE' Tables

Versioning

- adds 3 more tables per versioned feature class

Page 37: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 38: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 39: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 40: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 41: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 42: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 43: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 44: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 45: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 46: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker
Page 47: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Spatial isn't special.*

Page 48: 2015 FOSS4G Track: The Spatial Database - Lessons from the Enterprise and PostGIS by Matthew Baker

Matthew BakerDenver Public Schools

@mapBaker

[email protected]

Thank you!