Hi, I use mapnik to visualise road-centre-lines and loaded all road classes into a single PostGIS table.
The problem I experience is that mapnik renders the centre lines in the order how the road-centrelines are stored in the database table; which makes sense. So what happens that a minor road overlays a highway on an intersection (I use line-cap round). The table is clustered by the geometry index and I thing when I would recluster the table by the class_def field (the draw priority field), the database query will be much slower. I tried to define the layer data-source like this: <Datasource> <Parameter name="type">postgis</Parameter> <Parameter name="dbname">mydb</Parameter> <Parameter name="host">127.0.0.1</Parameter> <Parameter name="user">user</Parameter> <Parameter name="password">password</Parameter> <Parameter name="estimate_extent">true</Parameter> <Parameter name="table">(select * from roadcl order by class_def) as foo</Parameter> </Datasource> The SQL query will not use the spatial index anymore because Postgres orders the table first (via sequence scan) before applying the spatial filter (the extents of the current view). One solution I can think of is to slit all road-centrelines into separate tables and define separate layers accessing those tables. But maybe there is a way to define the table-parameter to run the spatial index first and layer order the results to define the draw order? Cheers Rainer _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

