Patrick Maslen (3) [Avatar] Offline
#1
Hi, I'm learning a lot; some feedback from early part of ch1:

Bottom of p14, 'vanacular' should be 'vernacular'
Bottom of p19, 'through fare' should be 'thoroughfare'
First word in 1.4.4 - 'Alas' injects some black humour, but I suspect it's probably meant to be 'At last'

SQL at bottom of p23 incorrect, if earlier instructions have been followed. I got it to work with a series of queries similar to this, one for each franchise:

INSERT INTO ch01.restaurants (franchise, geom)
SELECT 'BKG'
, ST_Transform(
ST_GeomFromText('POINT(' || lon || ' ' || lat || ')', 4269)
, 2163) As geom
FROM ch01.restaurants_staging
WHERE franchise = 'b';


Listing 1.6 incorrect, if earlier instructions have been followed. I got it to work as follows:
SELECT f.franchise
, COUNT(DISTINCT r.id) As total --
FROM ch01.restaurants As r
INNER JOIN ch01.lu_franchises As f ON r.franchise = f.id
INNER JOIN ch01.highways As h ON ST_DWithin(r.geom, h.geom, 1609) --
GROUP BY f.franchise
ORDER BY total DESC;

However the code downloads seems a more logical way to name fields than the system used in the pdf.

Also the results of this query at top of p27 seem incomplete - there shd also be results for Hardee (1077), Jack in the Box (509), Carl's Jr (224) and In-N-Out (44).

Hope this helps

Pat Maslen