maptiles/layers/exploration/layer.sql

7 lines
404 B
MySQL
Raw Normal View History

2024-10-05 10:43:33 +02:00
CREATE OR REPLACE FUNCTION layer_exploration(bbox geometry, zoom_level int)
RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text, name text, memorial text) AS $$
SELECT osm_id * 10 + 1, geometry, class, subclass, NULLIF(name, '') AS name, NULLIF(memorial, '') AS memorial
2024-10-05 10:43:33 +02:00
FROM osm_exploration_point
WHERE zoom_level >= 14 AND geometry && bbox;
$$ LANGUAGE SQL IMMUTABLE;