[Tile-serving] [osm2pgsql-dev/osm2pgsql] Linking between nodes and ways (Discussion #2455)
dch0ph
notifications at github.com
Sun Apr 19 17:29:12 UTC 2026
OK, I now have a [first working iteration](https://gist.github.com/dch0ph/59c7f7ad8cbc3f34766b3fb463e40817) that renders TCs using OSM Carto:
<img width="38" height="31" alt="image" src="https://github.com/user-attachments/assets/7955d313-6ff8-4e1f-8330-33223dd51930" />
1. Resolved. I could indeed just leave it empty.
2. I'm only segmentizing non-highway ways to get round this. This shouldn't be a problem since highways are generally over-fragmented anyway.
3. Resolved.
4. I haven't worked out how to change `process_relation` or whether I need to. Ways are being added from relations, but do I need to check whether they are highways? If so, I can't simply pass them into `check_highway` since I don't have a "way" object or a way geometry that is guaranteed to be a simple linestring.
5. I'm storing the "feature type" (mini roundabout vs. turning circle etc.) in the initial "node cache table" (`special_nodes_on_highways`), but I don't think I have access to this table within `process_way`, i.e. I'm not able to copy the feature type into the "final linking table" (`highways_on_special_nodes`).
6. I thought that the "final linking table" was way-based, i.e. the spatial index was on the way. But the output below shows the index is on the node. As a result, I'm not convinced that the updating will work correctly (e.g. if the highway is deleted).
7. I've ended up doing a double join (in `turning-circles.mml`) to be able to access the tags on both the node and way in a general way. I've no idea how (in)efficient this is. I assume that the joining via `osm_id`s is relatively quick (at least compared to the spatial join), Neither the node nor way ids can be used as a primary key.
> Column | Type | Collation | Nullable | Default
---------+---------------------------+-----------+----------+---------
osm_id | bigint | | not null |
node_id | bigint | | not null |
node | geometry(Point,3857) | | not null |
highway | text | | not null |
way | geometry(LineString,3857) | | not null |
Indexes:
"planet_osm_highways_with_special_nodes_node_idx" gist (node) WITH (fillfactor='100')
I'm pretty much at the edge of my comfort zone at this point. The performance relative to status quo should be evaluated by somebody who knows what they are doing...
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2455#discussioncomment-16625638
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2455/comments/16625638 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20260419/5042b06e/attachment.htm>
More information about the Tile-serving
mailing list