You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM (SELECT l1.group_number AS g1, l1.volume as volume, l1.dir_bin as dir_bin, l2.volume as neighbourvolume, place_holder_time_var, row_number() OVER (PARTITION BY l1.group_number,l1.volume ORDER BY ST_Distance(l1.shape, l2.shape))
FROM segments l1, segments l2
WHERE ST_DWithin(l1.shape, l2.shape, 500) AND l1.group_number != l2.group_number AND l1.feature_code=$1 AND l2.feature_code=$1) A
WHERE row_number < 5
GROUP BY g1, place_holder_time_var, volume
ORDER BY random()
LIMIT (SELECT COUNT(*) FROM segments WHERE feature_code=$1)*$2/100