Closed loreabad6 closed 5 years ago
I changed the code for Delft to this:
AND (ST_Area(ST_Intersection(l.geometry, b.geometry)) > 100000
OR ST_Contains(b.geometry, l.geometry));
But this is only a momentary solution, and does not work, for example, for Venlo.
Fixed on https://github.com/loreabad6/masters-thesis-geotech/commit/ec8a676cf5dd77eba25f0c759e1b3eecc403e077 by working with the percentage of the area intersected, instead of the area of intersection itself. Will include this on all the codes for selecting areas inside the boundary:
DROP TABLE IF EXISTS generated.sa_pop_grid;
CREATE TABLE generated.sa_pop_grid AS
SELECT l.cell_id, l.lsoa11nm, l.population, l.jobs, l.geometry
FROM received.lsoa l, received.sa_boundary b
WHERE ST_Intersects(l.geometry,b.geometry)
AND (ST_Area(ST_Intersection(l.geometry, b.geometry))/
ST_Area(l.geometry) > 0.7
OR ST_Contains(b.geometry, l.geometry));
So before the fix I had this:
And after:
There are issues in the
country
script for example in the UK in Corby, where an additional LSOA is added in spite of intersecting with the OSM boundary.The same goes for the Netherlands, in Delft, one buurt does not show because of the way I call the data:
Besides, I am not using a buffer around the study area as it increases it in area considerably, and would mean that I should include them within the downloaded OSM data. I keep the boundary feature mainly for the GEOSTAT data set for general use in Europe, but will take a look at the results when I add the US to the possible analyses and compare results with PFB.