Hallo Walter,
habe deinen Vorschlag mal probiert. Leider ohne Erfolg…
Der layer-Eintrag sieht jetzt bei mir so aus:
<Layer name="sac-scale" status="on" srs="&osm2pgsql_projection;">
<StyleName>sac-scale</StyleName>
<Datasource>
<Parameter name="table">
(select way,highway,
case when sac_scale='hiking' then 'T1' end
from &prefix;_line
where highway is not null
order by z_order) as roads
</Parameter>
&datasource-settings;
</Datasource>
</Layer>
Das Ganze führt dann hierzu:
render_tiles( (10.0, 47.23, 10.4, 47.45) sac-scale.xml tiles/sac/ 14 15 sac_scale)
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "./sac_scale.py", line 116, in loop
self.render_tile(tile_uri, x, y, z)
File "./sac_scale.py", line 98, in render_tile
mapnik.render(self.m, im)
RuntimeError: Postgis Plugin: PSQL error:
ERROR: column "sac_scale" does not exist
LINE 1: SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","tra...
^
Full sql was: 'SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","trail_visibility","tunnel" FROM (select way,highway,
case when sac_scale='hiking' then 'T1' end
from planet_line
where highway is not null
order by z_order) as roads WHERE "way" && ST_SetSRID('BOX3D(1112923.131832166 6012230.896798821,1115369.116737292 6014676.881703949)'::box3d, 900913)'
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "./sac_scale.py", line 116, in loop
self.render_tile(tile_uri, x, y, z)
File "./sac_scale.py", line 98, in render_tile
mapnik.render(self.m, im)
RuntimeError: Postgis Plugin: PSQL error:
ERROR: column "sac_scale" does not exist
LINE 1: SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","tra...
^
Full sql was: 'SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","trail_visibility","tunnel" FROM (select way,highway,
case when sac_scale='hiking' then 'T1' end
from planet_line
where highway is not null
order by z_order) as roads WHERE "way" && ST_SetSRID('BOX3D(1112923.131832166 6007338.926988571,1115369.116737292 6009784.911893697)'::box3d, 900913)'
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "./sac_scale.py", line 116, in loop
self.render_tile(tile_uri, x, y, z)
File "./sac_scale.py", line 98, in render_tile
mapnik.render(self.m, im)
RuntimeError: Postgis Plugin: PSQL error:
ERROR: column "sac_scale" does not exist
LINE 1: SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","tra...
^
Full sql was: 'SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","trail_visibility","tunnel" FROM (select way,highway,
case when sac_scale='hiking' then 'T1' end
from planet_line
where highway is not null
order by z_order) as roads WHERE "way" && ST_SetSRID('BOX3D(1112923.131832166 6009784.911893696,1115369.116737292 6012230.896798821)'::box3d, 900913)'
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "./sac_scale.py", line 116, in loop
self.render_tile(tile_uri, x, y, z)
File "./sac_scale.py", line 98, in render_tile
mapnik.render(self.m, im)
RuntimeError: Postgis Plugin: PSQL error:
ERROR: column "sac_scale" does not exist
LINE 1: SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","tra...
^
Full sql was: 'SELECT ST_AsBinary("way") AS geom,"highway","sac_scale","trail_visibility","tunnel" FROM (select way,highway,
case when sac_scale='hiking' then 'T1' end
from planet_line
where highway is not null
order by z_order) as roads WHERE "way" && ST_SetSRID('BOX3D(1112923.131832166 6014676.881703947,1115369.116737292 6017122.866609074)'::box3d, 900913)'
Das Terminal bleibt hängen und das wars…
Dass die Wanderwege zumindest farbig dargestellt werden, funktioniert mit folgender layer-Angabe:
<Layer name="sac-scale" status="on" srs="&osm2pgsql_projection;">
<StyleName>sac-scale</StyleName>
<Datasource>
<Parameter name="table">
(select way,highway,sac_scale,trail_visibility,
case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel,
case when bridge in ('yes','true','1') then 'yes'::text else bridge end as bridge
from &prefix;_line
where highway is not null
order by z_order) as roads
</Parameter>
&datasource-settings;
</Datasource>
</Layer>
Hänge ich deine case-Abfrage noch zusätzlich dort hinein, wird zwar gerendert, aber es steht weiterhin hiking, mountain_hiking, alpine_hiking etc. an den Wegen.
Irgendwelche Ideen?
Gruß
Andreas