As discussed in the development Roadmap, there is currently limited "linkage" 
between different geometry types.

This isn't a problem for 95% of rendering, but there are cases where it is 
necessary to cross-reference between a node and the way(s) it is part of. 
Currently, for example, the turning circle / loop / mini-roundabout rendering 
in OSM Carto requires a relatively expensive and inelegant spatial join 
(`ST_DWithin`) to (re)determine the types of highways that a turning circle is 
connected to and then render with the correct colour etc. There are other 
places where we would like to do similar things, e.g. resolve problems with 
level crossings where the starting zoom level should be adjusted based on the 
type of railway it attached to, adjust station rendering depending on railway 
type etc.

As I understand, "linkage" between ways and multipolygons is achieved with 
callback functions so that relevant tags from the MP can be attached to 
constituent ways. You can imagine a similar mechanism for nodes / ways, where 
specific node types register a callback for further tag processing. That said, 
I don't think this callback mechanism is the most flexible / elegant solution, 
not least because you would need to make decisions about combining tags from 
multiple ways at import time.

I think the most flexible approach would be an explicit "node/way correlation 
table" with a row for every "connection of interest" e.g. turning circles, 
level crossings, railway stations etc. You would probably need to add primary 
key (serial-like type) to the node and way tables, rather than use the OSM ID 
as key/index. But having done this, the spatial joins would be simply replaced 
by normal SQL joins.

In the longer term, I'm sure there would be other applications of linking ways 
and nodes e.g. site-like relations where you would then know which nodes were 
contained within which bounding area.

[There was some related, but unresolved discussion in #2311.]

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2455
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/[email protected]>
_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving

Reply via email to