prochitecture / blosm

GNU General Public License v3.0
11 stars 3 forks source link

Side effect of using VisibilityInfo.numMostlyPerpWaySegments for corner facades #14

Closed vvoovv closed 3 years ago

vvoovv commented 3 years ago

It requires fine tuning. I'll investigate it.

image

polarkernel commented 3 years ago

I observed, that the facet facades (blue arrows) in _manhattan01.osm get correctly classified as front facades. They are not excluded due to their angles in the condition at line 50 in facade_classification.py, because the condition visInfo.numMostlyPerpWaySegments >= 2 is True. But their sight value edgeSight is larger than the threshold FrontFacadeSight, so that they get classified as front facades, like all the other facades, that meet the angle condition.

However, the condition in line 72, originally intended for this special case, is not used for these facet facades, but produces wrong classifications (red arrows) on other edges. If we remove (comment) lines 72-74 delivers correct results for all edges, in my opinion.

I don't know, where your examples above is made from, but I assume, these wrong classifications would be correct too.

vvoovv commented 3 years ago

I commented the code at _action/facadeclassification.py to treat the corner facades. Yes, it solved the problem of corner facades in _manhattan01.osm. It also solved the problem from the first message (_berlin_karl_marxallee.osm, marked on the image below along with the corner facade).

However a corner facade in _berlin_karl_marxallee.osm isn't classified correctly.

image

image

polarkernel commented 3 years ago

I refactored the classification code and tried another approach for these corner facades. The algorithm works as follows:

  1. Find front facades using the first step of the current algorithm.
  2. Identify unclassified facades that lie between two front facades.
  3. Take the two way-segments, that are associated to these front facades.
  4. Using there unit vectors, compute their dot product, which is the cosine of the angle between them.
  5. If the cosine is below a threshold CornerFacadeWayAngle, classify the facade between the front facades as front facade.

This is still your idea of looking at the angles of the way-segments, but from another perspective. It seems to solve all issues with these corner facades we had until now. The new code is committed.

vvoovv commented 3 years ago

The method works perfectly. But what if there are more then one corner facades or what if the corner part has the form of an arc?

I'll close the issue till we encounter an example for that cases.