[Tile-serving] [osm2pgsql-dev/osm2pgsql] Add grouped-linemerge generalization (PR #2482)

leijurv notifications at github.com
Fri Jun 5 20:45:26 UTC 2026


leijurv left a comment (osm2pgsql-dev/osm2pgsql#2482)

> Deleted ways are gone from the source table without a trace.

Wait sorry, I don't mean to be difficult, but just to clarify: Yes, by the time the generalization runs, a deleted way is completely gone from `planet_osm_line`. But, isn't it possible to have a table, like `glm_expired_points`, which is just a bunch of `ST_Point`s, where whenever a way is deleted, I add both endpoints to this table? Then when the generalization runs, it can find the geometries that were made from this now-deleted way, because this endpoint will be an internal point of those geometries?

I thought this was possible because joto said [above](https://github.com/osm2pgsql-dev/osm2pgsql/pull/2482#issuecomment-4612569189): `For instance, you can have a separate table where you store (the "way" processing function) all the ids of ways that changed, then use that table as input for the rest of the processing in the "gen" step.`

Pseudocode:

```py
def way_created(way):
    INSERT INTO glm_expired_points(pts) VALUES (ST_StartPoint(way)), (ST_EndPoint(way));

def way_tags_updated(way):
    INSERT INTO glm_expired_points(pts) VALUES (ST_StartPoint(way)), (ST_EndPoint(way));

def way_deleted(way):
    INSERT INTO glm_expired_points(pts) VALUES (ST_StartPoint(way)), (ST_EndPoint(way));
```

I don't think I need to store the way itself, or delay its deletion/update in any way. I only need to know its endpoints.

The lookup of "this way was deleted" --> "which linemerged geometries are now expired" is just `ST_Intersects`?

> Computing the destination with grouping and line merge takes 9min30s and produces a table with 35_462_494 rows. Utterly feasible.

Great!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2482#issuecomment-4635396976
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/pull/2482/c4635396976 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20260605/078295b9/attachment.htm>


More information about the Tile-serving mailing list