PGMapCSS is a library for PostgreSQL/PostGIS which works between an osm2pgsql based database and Mapnik (and maybe other renderers). It processes database (usually OpenStreetMap) objects according to MapCSS rules and calculates resulting colors, widths and other properties for Symbolizers, even geometric modifications.
If you have a selector relation[type=route] way, all ways in the current bounding box will be selected from the database and for each of the ways a query whether it is member of a relation of type=route will be made. This is not very efficient.
To query all relations in the current bounding box is not possible, as there's no geometry column on the planet_osm_rels table and only some relations will be added to planet_osm_line resp. planet_osm_polygon. But for later relations it would be possible to optimize the select statements.
The following relations are added to planet_osm_line:
(type=boundary, type=multipolygon,) type=route
The following relations are added to planet_osm_polygon:
type=multipolygon, type=boundary
Another problem: the 'type' is neither added to planet_osm_line.type nor .tags.
If you have a selector
relation[type=route] way
, all ways in the current bounding box will be selected from the database and for each of the ways a query whether it is member of a relation of type=route will be made. This is not very efficient.To query all relations in the current bounding box is not possible, as there's no geometry column on the planet_osm_rels table and only some relations will be added to planet_osm_line resp. planet_osm_polygon. But for later relations it would be possible to optimize the select statements.
The following relations are added to planet_osm_line:
The following relations are added to planet_osm_polygon:
Another problem: the 'type' is neither added to planet_osm_line.type nor .tags.