add etldoc to layer_poi
This commit is contained in:
parent
b0c762cd2b
commit
dd2fc0e2dd
22
gen_etl_graph_poi.sh
Executable file
22
gen_etl_graph_poi.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
|
ID=poi
|
||||||
|
DOT=${ID}.dot
|
||||||
|
|
||||||
|
echo "digraph G
|
||||||
|
{
|
||||||
|
rankdir=LR;
|
||||||
|
" > $DOT
|
||||||
|
|
||||||
|
cat ./layers/${ID}/mapping.yaml | grep "# etldoc:" | sed 's/# etldoc://g' >>$DOT
|
||||||
|
|
||||||
|
cat ./layers/${ID}/class.sql | grep "\-\- etldoc:" | sed 's/-- etldoc://g' >>$DOT
|
||||||
|
cat ./layers/${ID}/layer.sql | grep "\-\- etldoc:" | sed 's/-- etldoc://g' >>$DOT
|
||||||
|
|
||||||
|
echo "
|
||||||
|
}
|
||||||
|
" >> $DOT
|
||||||
|
|
||||||
|
cat $DOT
|
||||||
|
|
||||||
|
dot -Tpng $DOT > layer_${ID}_etl.png
|
||||||
@ -1,3 +1,7 @@
|
|||||||
|
|
||||||
|
-- etldoc: layer_poi[shape=record fillcolor=lightpink, style="rounded,filled",
|
||||||
|
-- etldoc: label="layer_poi | <z14_> z14_" ] ;
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION layer_poi(bbox geometry, zoom_level integer, pixel_width numeric)
|
CREATE OR REPLACE FUNCTION layer_poi(bbox geometry, zoom_level integer, pixel_width numeric)
|
||||||
RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class text, subclass text, "rank" int) AS $$
|
RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class text, subclass text, "rank" int) AS $$
|
||||||
SELECT osm_id, geometry, name, NULLIF(name_en, ''), poi_class(subclass) AS class, subclass,
|
SELECT osm_id, geometry, name, NULLIF(name_en, ''), poi_class(subclass) AS class, subclass,
|
||||||
@ -5,6 +9,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class t
|
|||||||
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
||||||
ORDER BY poi_class_rank(poi_class(subclass)) ASC, length(name) DESC
|
ORDER BY poi_class_rank(poi_class(subclass)) ASC, length(name) DESC
|
||||||
)::int AS "rank"
|
)::int AS "rank"
|
||||||
|
-- etldoc: osm_poi_point -> layer_poi:z14_
|
||||||
FROM osm_poi_point
|
FROM osm_poi_point
|
||||||
WHERE geometry && bbox
|
WHERE geometry && bbox
|
||||||
AND zoom_level >= 14
|
AND zoom_level >= 14
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
tables:
|
tables:
|
||||||
|
# etldoc: imposm3 -> osm_poi_point
|
||||||
poi_point:
|
poi_point:
|
||||||
type: point
|
type: point
|
||||||
fields:
|
fields:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user