From a39334e9d4a5124b679ae2937a5be91e7f282ac1 Mon Sep 17 00:00:00 2001 From: Philippe Clastre Date: Tue, 8 Sep 2020 11:37:56 +0200 Subject: [PATCH] Update data.sql: generate new table "full_blurred_sites" in which you will find a line of each point in unblurred_sites table. Fully overlapped point will have a special null coordinates geojson string --- data.sql | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/data.sql b/data.sql index 00f1bbe..14081c9 100644 --- a/data.sql +++ b/data.sql @@ -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;