Skip to content
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

Use ST_PointOnSurface for junctions #3933

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Conversation

jeisenbe
Copy link
Collaborator

@jeisenbe jeisenbe commented Oct 15, 2019

Related to #3201

Changes proposed in this pull request:

  • Use ST_PointOnSurface for junctions layer in project.mml

Test rendering:

Before
junction-area-before

After
z17-junction-area-after

This PR will need to be updated after #3915 is merged

@matkoniecz
Copy link
Contributor

Sadly, this now has merge conflicts.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Nov 9, 2019

I've rebased the PR and fixed the merge conflicts. The rendering examples above are unchanged.

(I wish PRs with merge conflicts would be marked on the list at https://github.com/gravitystorm/openstreetmap-carto/pulls - there isn't any way we can show this, is there?)

@jeisenbe jeisenbe requested a review from matkoniecz November 11, 2019 03:58
@jeisenbe
Copy link
Collaborator Author

Anyone available to review this?

@jeisenbe
Copy link
Collaborator Author

@pnorman - can you review this?

@jeisenbe jeisenbe mentioned this pull request Jan 25, 2020
Copy link
Collaborator

@pnorman pnorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I haven't run it.

@jeisenbe
Copy link
Collaborator Author

Thank you. Is that enough of a review to merge this PR?

Copy link
Collaborator

@imagico imagico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the SQL code should have the form as demonstrated by

https://github.com/gravitystorm/openstreetmap-carto/blob/master/project.mml#L354-L371

to make it clear if the WHERE condition applies to the whole query or just to the second component of the UNION ALL.

Apart from that the change itself seems fine - though i would suggest to consider dropping the rendering of polygons with junction=yes - there are only four percent of these with a name tag (1300) compared to 56 percent (19000) for nodes. Incentivizing tagging named junctions on polygons instead of nodes is bad for all data users and against established mapping practice and counterproductive for consistent mapping.

Copy link
Collaborator

@imagico imagico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - that was meant to be a 'request changes' review.

Copy link
Collaborator

@pnorman pnorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

way && !bbox! needs to be in both WHERE clauses.

When the bbox token appears in the query, Mapnik no longer adds it to the outer wrapping query, so with the current code it wouldn't have an index to use for the planet_osm_point part

@bhousel
Copy link

bhousel commented Jan 27, 2020

Apart from that the change itself seems fine - though i would suggest to consider dropping the rendering of polygons with junction=yes - there are only four percent of these with a name tag (1300) compared to 56 percent (19000) for nodes. Incentivizing tagging named junctions on polygons instead of nodes is bad for all data users and against established mapping practice and counterproductive for consistent mapping.

From what I understand, named junctions are somewhat important in Japan and Korea and an established mapping practice.

Their use is documented pretty well on the junction=yes page and we've been supporting them in iD for over 5 years (see openstreetmap/iD#2484).

@imagico
Copy link
Collaborator

imagico commented Jan 27, 2020

I am not proposing to stop rendering names on junctions, i am proposing to drop doing this for junction polygons which are not consistently used to map something specific and where there is clearly no agreement if they are supposed to carry a name tag or not.

The wiki in this case quite accurately describes the current use:

Therefore the explicit tagging is only necessary if the node has further properties, e.g. a name=* for named junctions in some countries.

The tag is also used on highway areas that need to be declared to be junctions.

So use of junction nodes to map named junctions is well defined and consistently used. The tagging of polygons with junction=yes however is mostly re-purposing the tag for something completely different. It is also cargo culting a supposed 'need' - but that is beside the point here.

94 percent of the junction polygons have an area:highway tag indicating the junction=yes is a secondary tag here as explained on the wiki. One of the birth errors of area:highway tagging (which i pointed out several years ago already) is that it tacks between the idea to duplicate semantic tags like names from linear highways and not doing so. Despite that mappers have with their mapping practice clearly demonstrated that they don't want to duplicate names (less than 2 percent of area:highway features have a name tag) so we are here throwing a wrench into the mechanics of consistent tagging development within the community by displaying counterproductive incentives directly working against a tagging trend towards consistency.

@jeisenbe
Copy link
Collaborator Author

consider dropping the rendering of polygons with junction=yes ... there are only four percent of these with a name tag (1300) compared to 56 percent (19000) for nodes

I agree.

Would you mind opening an issue about this, so it's not forgotten?

@jeisenbe
Copy link
Collaborator Author

I've pushed a new commit with the recommended changes. I hope I got the parenthesis right.

@bhousel
Copy link

bhousel commented Jan 27, 2020

So use of junction nodes to map named junctions is well defined and consistently used. The tagging of polygons with junction=yes however is mostly re-purposing the tag for something completely different. It is also cargo culting a supposed 'need' - but that is beside the point here.

Are we talking about the same thing?

I see this on the wiki right now:

Screenshot 2020-01-27 08 46 58

Isn't that encouraging people to do exactly the thing that you are dropping the rendering for?

@bhousel
Copy link

bhousel commented Jan 27, 2020

cc @sommerluk who seems to be the one who made the proposal, got it approved, updated the wiki, and opened the issue in iD.

@jeisenbe jeisenbe requested a review from pnorman January 28, 2020 06:45
@jeisenbe jeisenbe merged commit cd03dbe into gravitystorm:master Jan 28, 2020
@jeisenbe jeisenbe deleted the junction branch January 28, 2020 07:31
@baerbock
Copy link

baerbock commented Feb 4, 2020

@jeisenbe How does ST_PointOnSurface work differently vs the old rendering?

Here is an example of a named junction=yes in Japan: Is the current rendering more like "before" or like "after"?

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 5, 2020

ST_PointOnSurface is a different algorithm than the interior placement which we previously used in Mapnik (the rendering software which we use to render this style), but the main advantage is that ST_PointOnSurface is used to calculate a node instide of the polygon, and then this node is sent to Mapnik for rendering. This is often faster and will also work for vector tiles. Sometimes the placement was better with interior but sometimes the new ST_PointOnSurface rendering is better - there is not a clear postive or negative change overall. Both options sometimes create poor labeling points, unfortunately)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants