Skip to content

Commit

Permalink
(Attempt to) stop jumping markers
Browse files Browse the repository at this point in the history
Always use the oldest node (/relation/way if nodes don't exist)
  • Loading branch information
Famlam committed Jun 25, 2023
1 parent 194b21a commit ba12c8a
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions analysers/analyser_osmosis_wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,34 @@
sql10 = """
SELECT
(array_agg(tid))[1:10],
ST_AsText(any_locate((array_agg(type))[1], (array_agg(id))[1])),
ST_AsText(any_locate(substring(MIN(tid), 1, 1), substring(MIN(tid), 2)::bigint)),
w
FROM ((
SELECT
tags->'wikipedia' AS w,
'N' || id AS tid,
'N' AS type,
id
'N' || id AS tid
FROM
nodes
WHERE
tags != ''::hstore AND
tags?'wikipedia' AND
NOT tags->'wikipedia' LIKE '%#%' AND
NOT tags?| ARRAY['highway', 'railway', 'waterway', 'power', 'place', 'shop', 'network', 'operator']
ORDER BY
id
) UNION ALL (
SELECT
tags->'wikipedia' AS w,
'W' || id AS tid,
'W' AS type,
id
'W' || id AS tid
FROM
ways
WHERE
tags != ''::hstore AND
tags?'wikipedia' AND
NOT tags->'wikipedia' LIKE '%#%' AND
NOT tags?| ARRAY['highway', 'railway', 'waterway', 'power', 'place', 'shop', 'network', 'operator']
ORDER BY
id
) UNION ALL (
SELECT
tags->'wikipedia' AS w,
'R' || id AS tid,
'R' AS type,
id
'R' || id AS tid
FROM
relations
WHERE
Expand All @@ -72,8 +62,6 @@
NOT tags->'wikipedia' LIKE '%#%' AND
NOT tags->'type' IN ('route', 'boundary') AND
NOT tags?| ARRAY['highway', 'railway', 'waterway', 'power', 'place', 'shop', 'network', 'operator']
ORDER BY
id
)) AS t
GROUP BY
w
Expand Down

0 comments on commit ba12c8a

Please sign in to comment.