Skip to content

Commit

Permalink
uncomment pois displacement not working with setup
Browse files Browse the repository at this point in the history
  • Loading branch information
EPajares committed Nov 15, 2020
1 parent 33a359d commit dabf244
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/database/data_preparation/SQL/pois.sql
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ UPDATE pois p SET amenity = 'nursery'
WHERE amenity = 'kindergarten'
AND (tags -> 'max_age') = '3';
--- Replicate nurseries to duplicate kindergartens and displace
SELECT pois_rewrite('nursery','kindergarten','%kindergarten%');
SELECT pois_displacement(ARRAY['nursery','kindergarten'], (3/(27*3600)::float8));
--SELECT pois_rewrite('nursery','kindergarten','%kindergarten%');
--SELECT pois_displacement(ARRAY['nursery','kindergarten'], (3/(27*3600)::float8));
------------------------------------------end kindergarten-------------------------------------------

-- Reclassificate shops
Expand All @@ -347,8 +347,8 @@ CREATE INDEX ON pois(amenity);
---------------------------------------- Refine and move POIS ---------------------------------------
-------------------------------------- Displace overlapped POIS -------------------------------------

SELECT pois_displacement(ARRAY['nursery','kindergarten'], 5::float8, 50::float8, 30::float8);
SELECT pois_displacement(ARRAY['primary_school','secondary_school'], 5::float8, 50::float8, 30::float8);
--SELECT pois_displacement(ARRAY['nursery','kindergarten'], 5::float8, 50::float8, 30::float8);
--SELECT pois_displacement(ARRAY['primary_school','secondary_school'], 5::float8, 50::float8, 30::float8);

----------------------------------- Refine POIS based on categories ----------------------------------
SELECT pois_reclassification('shop','grocery','amenity','convenience','singlevalue');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ BEGIN

--- Load adjusted pois out of boundary to duplicated

UPDATE pois
UPDATE pois
SET geom = (CASE WHEN pois.osm_id = ANY (SELECT DISTINCT osm_id FROM pois_duplicated) THEN subquery.geom
ELSE pois.geom END)
FROM (SELECT * FROM pois_duplicated) AS subquery
Expand Down

0 comments on commit dabf244

Please sign in to comment.