[Tile-serving] [openstreetmap/osm2pgsql] Ideas for improved geometry processing (Issue #1663)

Kevin B Kenny notifications at github.com
Sat Sep 17 19:46:58 UTC 2022


> I have been thinking about similar issues for other use cases I want to support somewhere down the line, for instance generalization of roads for small zoom levels. They have in common that they need some kind of network analysis of the road network that goes beyond simple geometry processing. That's definitely something we can't currently do in osm2pgsql, because osm2pgsql only looks at one object at a time, but it is something that we might be able to do with osm2pgsql and the database together, if we can find the right model of approaching this. It is definitely in scope for the [generalization project](https://osm2pgsql.org/generalization/), so I do want to hear about those use cases, although it would have fit better in a new discussion thread.

(Agreed that we probably need a new thread for this... but... sorry, I'm here now.)

One use case tor me has been the placement of highway shields on route concurrencies.  This involves quite a bit of postprocessing at query time (surprisingly, it's not all that slow!) to construct the topology of strings of ways with the same cluster of routes.

You can see the code that I use at https://github.com/kennykb/osm-shields.  `shieldtables.lua` populates the auxiliary tables, and then the heavy lifting happens in the `analyze_merkers` SQL function in `queryprocs.sql.in`. The key to how it works is that  it extracts members of the same _set_ of routes (not just the same routes), and then groups them as much as possible with the PostGIS `ST_LineMerge` function.  I use this code regularly for my own work; it's almost certainly NOT ready for any kind of production, but it works well enough for me at the moment.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/1663#issuecomment-1250130684
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/issues/1663/1250130684 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220917/d072d20e/attachment.htm>


More information about the Tile-serving mailing list