Migrate old, locationless activities
This commit is contained in:
parent
debc55d484
commit
47fd3808d2
1 changed files with 18 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
UPDATE activities a
|
||||
SET activity_location =
|
||||
concat(
|
||||
COALESCE(
|
||||
NULLIF(g.name_4, ''),
|
||||
NULLIF(g.name_3, ''),
|
||||
NULLIF(g.name_2, '')
|
||||
),
|
||||
', ',
|
||||
g.name_0
|
||||
)
|
||||
FROM gadm_410 g
|
||||
WHERE a.activity_location IS NULL
|
||||
AND a.simplified_track IS NOT NULL
|
||||
AND ST_Intersects(
|
||||
g.geom,
|
||||
ST_SetSRID(ST_StartPoint(a.simplified_track), 4326)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue