2015 foss4g track: the spatial database - lessons from the enterprise and postgis by matthew baker
TRANSCRIPT
Matthew BakerDenver Public Schools
The Spatial DatabaseLessons from the Enterprise...and PostGIS
--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)
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
Student Enterprise GIS
ArcSDE
42 Tables
ArcSDE Back End (SQL Server) > 100 'SDE' Tables
Versioning
- adds 3 more tables per versioned feature class
Spatial isn't special.*
Matthew BakerDenver Public Schools
The Spatial DatabaseLessons from the Enterprise...and PostGIS
Matthew Baker is the SR. GIS Analyst at Denver Public Schools
--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)
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
Student Enterprise GIS
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.
ArcSDE
42 Tables
ArcSDE Back End (SQL Server) > 100 'SDE' Tables
Versioning
- adds 3 more tables per versioned feature class
Spatial isn't special.*