Skip to content

Commit

Permalink
Update data.sql: generate new table "full_blurred_sites" in which you…
Browse files Browse the repository at this point in the history
… will find a line of each point in unblurred_sites table. Fully overlapped point will have a special null coordinates geojson string
  • Loading branch information
pclastre committed Sep 8, 2020
1 parent f618da2 commit a39334e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,17 @@ SELECT D.id AS lost_id, I.id AS overlapping_point
FROM donut D , disque_interieur I
WHERE ST_Contains(I.geom,D.geom) = true;

-- Step 6: count the number of lost points (their donuts are fully overlapped by a bigger donut !)
--Step 6: create a full version of the input table (unblurred_sites)with null value for coordinates in geojson when point is overlapped
DROP TABLE IF EXISTS full_blurred_sites;
CREATE TABLE full_blurred_sites AS
SELECT U.id,B.geojson FROM unblurred_sites as U
LEFT JOIN
blurred_sites AS B ON U.id = B.id;
UPDATE full_blurred_sites
SET geojson='{"type":"Point","coordinates":[NULL,NULL]}'
WHERE geojson IS NULL;

-- Step 7: count the number of lost points (their donuts are fully overlapped by a bigger donut !)
-- This is the returned value
SELECT INTO nb_perdus count(lost_id) FROM overlapping;

Expand Down

0 comments on commit a39334e

Please sign in to comment.