Skip to content
This repository has been archived by the owner. It is now read-only.

Polygons not rendering after removing them from relation #4525

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

Polygons not rendering after removing them from relation #4525

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Reporter: andrzej_aa
[Submitted to the original trac issue database at 8.24am, Wednesday, 15th August 2012]

Hi, I have some problems [http://www.openstreetmap.org/?lat=49.395441&lon=22.075842&zoom=18&layers=M here]. Some time ago I had a big relation of polygons and multipolygons. I've splited it up by removing all forests from relation and then I've removed that relation too. Now some of these polygons can't show on the map. At my example you can see one polygon visible. I edited it by moving one of its nodes by few millimeters and submited tile for rendering. I use latest version of JOSM.
I put it as osm2pgsql in response to [http://help.openstreetmap.org/questions/15074/polygons-not-rendering-after-removing-them-from-multipolygon this question].

@openstreetmap-trac
Copy link
Author

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Author: amm
[Added to the original trac issue at 4.57am, Monday, 27th August 2012]

If a way is part of a multi polygon relation, it gets processed via the relation and not as an individual way.

However, if a way is removed from a relation, osm2pgsql does not reprocess the way to see if it needs to be added back to the db as an individual way, and thus those ways do not show up in the rendering tables.

When modifying / deleting a relation, osm2pgsql has to do something like mark the ways in the relation as pending. But I am not yet sure if that is valid for those ways that remain in the relation. I am also not sure if it is valid if a way is a member of multiple relations and only gets removed from one of them.

A fix might also slow down diff processing depending on how it is fixed.

@openstreetmap-trac
Copy link
Author

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Author: amm
[Added to the original trac issue at 4.51pm, Sunday, 28th October 2012]

I think this bug can be solved by adding a
"PREPARE rel_delete_mark(" POSTGRES_OSMID_TYPE ") AS UPDATE %p_ways SET pending = true WHERE id IN (SELECT unnest(parts[way_off+1:rel_off]) FROM %p_rels WHERE id = $1) AND NOT pending;" into the rels_delete() in middle-pgsql.

I.e. it would mark all ways as pending (for reprocessing) that are part of a relation that is modified. So if the relation gets deleted or changed from a multi-polygon, it will process the ways again to see if now that they aren't in the relation anymore they need to be added to the rendering tables by them selves.

I am not sure what this does to processing speed of diffs though, or if there is a more efficient way of doing this.

@openstreetmap-trac
Copy link
Author

@openstreetmap-trac openstreetmap-trac commented Jul 23, 2021

Author: amm
[Added to the original trac issue at 6.19am, Wednesday, 28th August 2013]

Closing this, as I have just committed a fix for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant