Closed Famlam closed 10 months ago
I think DISTINCT ON
is the right way to do it.
But DISTINCT ON
should never be used without ORDER BY
like it the case here.
But 'DISTINCT ON' wouldn't give constant results either, even with 'ORDER BY', in diff mode, right? Should we remove diff mode? Or add 'b1.id' to the output
I prefer keep the diff mode when possible. So lets try to add ORDER BY
+ b1.id
.
It seems the original issue resolved itself (maybe a full run was triggered, or the bad ways have been modified/removed since, such that it no longer triggers the error)
I'll keep the issue open as it should be a very simple fix. (Although I still don't know why triangular buildings are considered bad in France 🤔)
Although I still don't know why triangular buildings are considered bad in France 🤔)
Building come from french Cadaster and the building are split by land plot and should be merged before upload. And small triangle can be spoted when it is not the case.
Building come from french Cadaster and the building are split by land plot and should be merged before upload. And small triangle can be spoted when it is not the case.
Thanks! As this analyser has a 1/3th false positive rate (5695 false positives vs 12394 open issues) I also looked at some false positives. A split by a land plot would mean that at least 2 adjacent points should be connected. If only one point is connected, it cannot be a split by land plots. Hence I also added a dimension check for the overlap. This solves a lot of the false positives.
This fixes issues like
From https://buildbot.osmose.openstreetmap.fr/#/builders/649/builds/1190/steps/3/logs/stdio :
The issue only occurs in diff mode.
It seems that this analyser runs
sql70
in diff mode with: run1: b1 =touched_buildings
vs b2 =buildings
run2: b1 =not_touched_buildings
vs b2 =touched_buildings
Here, b2.id is the outputI suspect this may fail if there's three buildings: A, B, C, where all intersect "A" (and A is a triangular building). If "A" and "C" gets touched, then run1: b1 = A,C, b2 = A,B,C -> output: A (due to intersection A-C) run2: b1 = B, b2 = A,C -> output A (due to intersection A-B) Giving twice A as output
If so, the solution is probably to also include the second way (
b1
) in the output too? The downside is that the second way (b1
) would constantly change depending on which building was touched, due to theDISTINCT ON
. Alternatively, diff mode should be removed.P.s. I'm not entirely sure what this analyser does. It seems that it searches for triangular buildings that are touching other buildings, but I'm not entirely sure what's wrong with that? Or is it a common import error in France? (Or a forbidden building shape)