Database Reference
In-Depth Information
Calculating
demographics
using
driving distance
Inthe Using polygon overlays for proportional census estimates recipein Chapter2 ,
Structures that Work , we employed a simple buffer around a trail alignment in con-
junctionwiththecensusdatatogetestimatesofwhatthedemographicswereofthe
peoplewithinwalkingdistanceofthetrail,estimatedasadistanceof1mile.Theprob-
lem with this approach, of course, is that it assumes that it is an "as the crow flies"
estimate.Inreality,rivers,largeroads,androadlessstretchesserveasrealbarriers
to people's movement through space. Using pgRouting's pgr_drivingDistance
function, we can realistically simulate people's movement on routable networks and
getbetterestimates.Forourusecase,we'llkeepthesimulationabitsimplerthana
trailalignment—we'llconsiderthedemographicsofaparkfacility,say,theCleveland
Metroparks Zoo, and potential bike users within 4 miles of it, which we estimate as
approximately a 15 minute bike ride.
Getting ready
Forouranalysis,wewillusethe proportionalsum functionfrom Chapter2 , Struc-
tures that Work ; so if you have not added this to your PostGIS tool belt, run the fol-
lowing commands:
CREATE OR REPLACE FUNCTION
chp02.proportional_sum(geometry, geometry,
numeric)
RETURNS numeric AS
$BODY$
SELECT $3 * areacalc FROM
(
SELECT (ST_Area(ST_Intersection($1,
$2))/ST_Area($2))::numeric AS areacalc
) AS areac
;
$BODY$
LANGUAGE sql VOLATILE;
Search WWH ::




Custom Search