-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unpaved rendering for turning circles #4770
base: master
Are you sure you want to change the base?
Conversation
@@ -611,8 +611,14 @@ Layer: | |||
<<: *osm2pgsql | |||
table: &turning-circle_sql |- | |||
(SELECT DISTINCT ON (p.way) | |||
p.way AS way, | |||
-- Valid line geometry requires at least two points that are NOT identical, therefore moving them slightly. | |||
ST_MakeLine(ST_Translate(p.way, -0.0001, -0.0001), ST_Translate(p.way, 0.0001, 0.0001)) AS way, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like generating fake lines. Why can't we use a point and crop out an appropriately sized circle from the unpaved pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would mean cutting about 30 different circular SVGs from the patterns. And you would still get a discontinuity of the pattern rendering at the transit from the turning circle to the linear road.
The other alternative would be using ST_Buffer() + polygon pattern, but that would require the road width progression to be available in SQL. On the other hand, that would allow merging the turning circle and highway area layers and this way could reduce size of roads.mss quite a bit...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @imago explained, using a point geometry
would mean cutting about 30 different circular SVGs from the patterns
Therefore, I think what is proposed in this PR is easier in code and maintenance.
It might seem in slightly poor taste to highlight this PR following the recent changes in maintainers, but ... I don't see a problem in creating a fake line to address a rendering issue - it's not as though the underlying data(base) is being manipulating.
Or is this a more promising long-term direction? I was wondering about how you might render passing places, but this would involve a lot of MSS code duplicating the road width progression, which would be avoided if the road width were evaluated in SQL. |
I don't think it is a particularly elegant solution but i also don't have principal objections against that. Background is that rendering line features with a polygon-like 2d fill pattern was a late addition to Mapnik - and it was done selectively for line features, not as a generic feature to be able to use a 2d pattern for anything that would otherwise be shown in a plain color. The need to also allow this for other features (in particular marker symbolizers and SVG symbols) was discussed in mapnik/mapnik#3977 - but never implemented. The choice by @sommerluk for using fake lines is likely based on the realization that this would not happen and we need to use a workaround of some kind. The three principal solutions for that have been mentioned already:
Among these option i see the first clearly as the most viable one. This would not rule out moving to the third in case a larger road rendering re-design should be pursued by someone in the future. |
Changes proposed in this pull request:
Test rendering with links to the example places:
https://www.openstreetmap.org/#map=19/6.53649/2.40256
Before
After