I’d like to make some maps where when I really zoom in the roads are rendered at the actual width.
I think I’ve figured out a SQL select statement to get pixel width values based on the width=* tag if it exists, or estimate it from lanes=* tag if that exists or from assumptions about the number of lanes and lane width from values of highway=* as a last resort.
But now I don’t see how to tell the renderer about it. The typical rendering rule is something like:
<Rule> <Filter> (([highway] = 'residential') or ([highway] = 'unclassified')) </Filter> <LineSymbolizer stroke="rgb(169,170,153)" stroke-width="8" stroke-linecap="round" smooth="0.7" /> </Rule>
When I try putting a SQL select field value after the stroke-width= it rejects it. I’ve tried
stroke-width="[pixel_width]" stroke-width="pixel_width" stroke-width=[pixel_width] stroke-width=pixel_width
Where pixel_width is the results of my SQL select’s calculation. The first two return and error message indicating that a number was expected. The latter two are invalid XML and are reported as such.
I guess if I back off from trying to do actual width properly scaled and just do lanes then I can setup a rule for each of the expected number of lanes and have the lane width in pixels hard coded for each zoom. But it seems I ought to be able to render a line with a width based on the width value someone has surveyed. Or in the case of using lanes, support an arbitrary number of lanes.