Given a layer called parcels
that has a column called abandoned
(0 or 1), we add a column called abandoned70ft
and to store the number of abandoned parcels within 70 feet.
UPDATE parcels
SET abandoned70ft = (
SELECT count(*)
FROM parcels a
WHERE a.abandoned = 1
AND ST_Distance(parcels.the_geom::geography, a.the_geom::geography)*3.28084 < 70
)