Replies: 2 comments 3 replies
-
|
In theory you could add a check in Lua code for every geometry using the get_bbox() function before you add it to a table to make sure it is "reasonable". But that would mean quite a lot of boiler-plate code. Another option would be to allow users to set a max bounding box on tables and do the check then behind the scenes in osm2pgsql. But that would still put the burden on the osm2pgsql user to configure this properly and chances are that not many people will do this. We could avoid large expire lists for, say, building layers this way, but other layers (like boundaries) will still need to allow huge areas, so I am not sure how useful this would be. The question is also whether we are defending against a mistake somewhere (like a mistagging or a moved node) or against an attacker. |
Beta Was this translation helpful? Give feedback.
-
|
Thinking some more about this, I am asking myself whether this is really about the geometry itself, not just the expire tiles. Drawing a 1000km² building is already a problem even if there is no expiry involved. That would give us also more options on how to do the checking. We can do this today, calculate the area or the length of a feature in Lua. It isn't a problem to not write such a geometry to an output table in which case it would also no show up in an expire list. So if somebody changes a building and makes it 1000 times bigger than before it would simply vanish, triggering an expiry of the tiles covering the old geometry. (Actually detecting that this is a problematic change and leaving the old object in place would be better, but that's a whole other can of worms.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
From #2427
I've been thinking about this as well but haven't yet seen discussion. I think detections will need to vary with the tagging so belong in the lua code of a transform. A 1000 square km building is an obvious bad edit but could be a valid lake.
Right now it's possible to do some detection in flex transforms and reject objects. Is there additional information that would help flex code detect bad edits? Do we need something more sophisticated than rejecting objects?
Beta Was this translation helpful? Give feedback.
All reactions