|
6 | 6 | -- |
7 | 7 | -- --------------------------------------------------------------------------- |
8 | 8 |
|
| 9 | +-- Set these to true in order to create a config file |
| 10 | +-- If you are creating a tilekiln config you must also create |
| 11 | +-- the 'shortbread_config' directory. |
| 12 | +local TREX = false |
| 13 | +local TILEKILN = false |
| 14 | + |
9 | 15 | local themepark = require('themepark') |
10 | 16 |
|
11 | 17 | themepark.debug = false |
@@ -63,46 +69,44 @@ themepark:add_topic('shortbread_v1/addresses') |
63 | 69 | -- Create config files only in create mode, not when updating the database. |
64 | 70 | -- This protects the file in case it contains manual edits. |
65 | 71 | if osm2pgsql.mode == 'create' then |
66 | | --- Enable if you want to create a config file for the T-Rex tile server |
67 | | --- |
68 | | --- themepark:plugin('t-rex'):write_config('t-rex-config.toml', { |
69 | | --- tileset = 'osm', |
70 | | --- extra_layers = { |
71 | | --- { |
72 | | --- buffer_size = 10, |
73 | | --- name = 'street_labels', |
74 | | --- geometry_type = 'LINESTRING', |
75 | | --- query = { |
76 | | --- { |
77 | | --- minzoom = 14, |
78 | | --- sql = [[ |
79 | | --- SELECT "name","name_de","name_en","kind","layer","ref","ref_rows","ref_cols","z_order","geom" |
80 | | --- FROM "streets" |
81 | | --- WHERE "geom" && !bbox! AND !zoom! >= "minzoom" |
82 | | --- ORDER BY "z_order" asc]] |
83 | | --- }, |
84 | | --- { |
85 | | --- minzoom = 11, |
86 | | --- maxzoom = 13, |
87 | | --- sql = [[ |
88 | | --- SELECT "name","name_de","name_en","kind","layer","ref","ref_rows","ref_cols","z_order","geom" |
89 | | --- FROM "streets_med" |
90 | | --- WHERE "geom" && !bbox! AND !zoom! >= "minzoom" |
91 | | --- ORDER BY "z_order" asc]] |
92 | | --- }, |
93 | | --- } |
94 | | --- } |
95 | | --- } |
96 | | --- }) |
97 | | - |
98 | | --- Enable if you want to create a config file for the Tilekiln tile server. |
99 | | --- (You must also create the directory 'shortbread_config'.) |
100 | | --- |
101 | | --- themepark:plugin('tilekiln'):write_config('shortbread_config', { |
102 | | --- tileset = 'shortbread_v1', |
103 | | --- name = 'OpenStreetMap Shortbread', |
104 | | --- attribution = '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap</a>' |
105 | | --- }) |
| 72 | + if TREX then |
| 73 | + themepark:plugin('t-rex'):write_config('t-rex-config.toml', { |
| 74 | + tileset = 'osm', |
| 75 | + extra_layers = { |
| 76 | + { |
| 77 | + buffer_size = 10, |
| 78 | + name = 'street_labels', |
| 79 | + geometry_type = 'LINESTRING', |
| 80 | + query = { |
| 81 | + { |
| 82 | + minzoom = 14, |
| 83 | + sql = [[ |
| 84 | +SELECT "name","name_de","name_en","kind","layer","ref","ref_rows","ref_cols","z_order","geom" |
| 85 | + FROM "streets" |
| 86 | + WHERE "geom" && !bbox! AND !zoom! >= "minzoom" |
| 87 | + ORDER BY "z_order" asc]] |
| 88 | + }, |
| 89 | + { |
| 90 | + minzoom = 11, |
| 91 | + maxzoom = 13, |
| 92 | + sql = [[ |
| 93 | +SELECT "name","name_de","name_en","kind","layer","ref","ref_rows","ref_cols","z_order","geom" |
| 94 | + FROM "streets_med" |
| 95 | + WHERE "geom" && !bbox! AND !zoom! >= "minzoom" |
| 96 | + ORDER BY "z_order" asc]] |
| 97 | + }, |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | + }) |
| 102 | + end |
| 103 | + if TILEKILN then |
| 104 | + themepark:plugin('tilekiln'):write_config('shortbread_config', { |
| 105 | + tileset = 'shortbread_v1', |
| 106 | + name = 'OpenStreetMap Shortbread', |
| 107 | + attribution = '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap</a>' |
| 108 | + }) |
| 109 | + end |
106 | 110 | end |
107 | 111 |
|
108 | 112 | -- --------------------------------------------------------------------------- |
0 commit comments