simplified etldoc for layer_place

This commit is contained in:
ImreSamu 2016-11-10 03:23:52 +01:00
parent 7d7ca7f47a
commit b0c762cd2b
4 changed files with 12 additions and 14 deletions

View File

@ -1,15 +1,10 @@
-- etldoc: layer_city[shape=record fillcolor=lightpink, style="rounded,filled", -- etldoc: layer_city[shape=record fillcolor=lightpink, style="rounded,filled",
-- etldoc: label="layer_city | <z2> z2 |<z3> z3 |<z4> z4 |<z5> z5| <z6> z6 |<z7> z7 | <z8> z8 |<z9> z9 |<z10> z10 |<z11> z11 |<z12> z12|<z13> z13|<z14_> z14_" ] ; -- etldoc: label="layer_city | <z2_7> z2-z7 | <z8_14_> z8_z14_ " ] ;
CREATE OR REPLACE FUNCTION layer_city(bbox geometry, zoom_level int, pixel_width numeric) CREATE OR REPLACE FUNCTION layer_city(bbox geometry, zoom_level int, pixel_width numeric)
RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class city_class, "rank" int) AS $$ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class city_class, "rank" int) AS $$
-- etldoc: osm_city_point -> layer_city:z2 -- etldoc: osm_city_point -> layer_city:z2_7
-- etldoc: osm_city_point -> layer_city:z3
-- etldoc: osm_city_point -> layer_city:z4
-- etldoc: osm_city_point -> layer_city:z5
-- etldoc: osm_city_point -> layer_city:z6
-- etldoc: osm_city_point -> layer_city:z7
SELECT osm_id, geometry, name, COALESCE(NULLIF(name_en, ''), name) AS name_en, place AS class, "rank" SELECT osm_id, geometry, name, COALESCE(NULLIF(name_en, ''), name) AS name_en, place AS class, "rank"
FROM osm_city_point FROM osm_city_point
WHERE geometry && bbox WHERE geometry && bbox
@ -30,13 +25,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class c
population DESC NULLS LAST, population DESC NULLS LAST,
length(name) ASC length(name) ASC
)::int AS gridrank )::int AS gridrank
-- etldoc: osm_city_point -> layer_city:z8 -- etldoc: osm_city_point -> layer_city:z8_14_
-- etldoc: osm_city_point -> layer_city:z9
-- etldoc: osm_city_point -> layer_city:z10
-- etldoc: osm_city_point -> layer_city:z11
-- etldoc: osm_city_point -> layer_city:z12
-- etldoc: osm_city_point -> layer_city:z13
-- etldoc: osm_city_point -> layer_city:z14_
FROM osm_city_point FROM osm_city_point
WHERE geometry && bbox WHERE geometry && bbox
AND ((zoom_level = 8 AND place <= 'town'::city_class) AND ((zoom_level = 8 AND place <= 'town'::city_class)

View File

@ -1,4 +1,7 @@
-- etldoc: layer_country[shape=record fillcolor=lightpink, style="rounded,filled",
-- etldoc: label="layer_country | <zall> z0-z14_ " ] ;
-- etldoc: osm_country_point -> layer_country -- etldoc: osm_country_point -> layer_country
CREATE OR REPLACE FUNCTION layer_country(bbox geometry, zoom_level int) CREATE OR REPLACE FUNCTION layer_country(bbox geometry, zoom_level int)
RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, "rank" int) AS $$ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, "rank" int) AS $$

View File

@ -1,4 +1,7 @@
-- etldoc: layer_place[shape=record fillcolor=lightpink, style="rounded,filled",
-- etldoc: label="layer_place | <zall> z0-z14_ " ] ;
-- etldoc: layer_country -> layer_place -- etldoc: layer_country -> layer_place
-- etldoc: layer_state -> layer_place -- etldoc: layer_state -> layer_place
-- etldoc: layer_city -> layer_place -- etldoc: layer_city -> layer_place

View File

@ -1,4 +1,7 @@
-- etldoc: layer_state[shape=record fillcolor=lightpink, style="rounded,filled",
-- etldoc: label="layer_state | <zall> z0-z14_ " ] ;
-- etldoc: osm_state_point -> layer_state -- etldoc: osm_state_point -> layer_state
CREATE OR REPLACE FUNCTION layer_state(bbox geometry, zoom_level int) CREATE OR REPLACE FUNCTION layer_state(bbox geometry, zoom_level int)