What is a spatial database as oppose to a geodatabase? In this talk, Matthew Baker will discuss the advantages of using spatial objects in a relational database to accomplish spatial, demographic, and statistical analysis at Denver Public Schools. This talk will also discuss how the Open Source IT stack teaches a new way of thinking about spatial data, and will also cover the ongoing research and challenges of moving to an open source spatial IT framework.
4. --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.shape
from
(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
)
5.
6. 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
25. Matthew Baker
Denver Public Schools
The Spatial Database
Lessons from the Enterprise...and PostGIS
Matthew Baker is the SR. GIS Analyst at Denver Public
Schools
26.
27.
28. --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.shape
from
(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
)
29.
30. 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
34. More details regarding this report-
The user can select a distance band
The user also selects whether or not to include students with multiple address or- only show
students with multiple addresses
The 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.