maptiles/layers/exploration/layer.sql

6 lines
404 B
PL/PgSQL

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
FROM osm_exploration_point
WHERE zoom_level >= 14 AND geometry && bbox;
$$ LANGUAGE SQL IMMUTABLE;