dssg / land-bank

Analytics tool to help the Cook County Land Bank acquire vacant and abandoned properties strategically.
http://dssg.io/projects#landbank
8 stars 8 forks source link

Overlapping ward polygons? #31

Closed skyinthecloud closed 10 years ago

skyinthecloud commented 11 years ago

Anyone care to figure this one out? In the assessor data, there's exactly one property that, by way of spatial query against our Wards geometry data, falls in BOTH of two adjacent wards. Run this query in postgres to see what I mean:

select ldw.ward
from landbank_data_wards as ldw, landbank_data_assessor as lda 
where ST_Intersects(lda.loc, ldw.geom) 
and lda.pin='21321000090000';

Which for every other PIN would yield exactly one ward number, but for the ward above gives:

 ward
------
    7
   10 
(2 rows)

I see two possibilities: the point for this parcel is on the boundary of two coterminous wards, or wards 7 and 10 overlap on this point.

Anyways, it's 1 point in ~2 million, so I'm ignoring it for now. As it is, the property is "vacant land" according to the assessor data.

skyinthecloud commented 11 years ago

After a quick search, I was relieved to find that no community areas nor census tracts so far appear to "share" any of the property centroids as in the issue above. How I know:

select lda.pin, count(*)
from landbank_data_censustract as ldc, landbank_data_assessor as lda
where ST_Intersects(lda.loc, ldc.loc)
group by lda.pin
having count(*)>1;

and

select lda.pin, count(*)
from landbank_data_communityareas as ldca, landbank_data_assessor as lda
where ST_Intersects(lda.loc, ldca.geom)
group by lda.pin
having count(*)>1;

both yield zero rows; therefore, no PINs from the assessor file are associated with more than one tract or community area. This is good news.

tplagge commented 10 years ago

Also, ST_Intersects will return true even if there's only a line intersection, i.e. a parcel is right on the border. So this is not a problem.