<table><tr><td style="">tandon updated this revision to Diff 5914.<br />tandon marked an inline comment as done.<br />tandon added a comment.</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D2376" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>This patch contains fixes for 2 of the 3 major problems,</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">-It fixes the appearance of star shaped aberrations in the output osm file.
-It fixes the bug which caused loss in detail of merged buildings</pre></div>
<p><a href="https://phabricator.kde.org/p/nienhueser/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;" rel="noreferrer">@nienhueser</a> suggested the fix for the star shaped aberrations on the lines of <a href="http://gis.stackexchange.com/a/60253" class="remarkup-link" target="_blank" rel="noreferrer">http://gis.stackexchange.com/a/60253</a> .<br />
However, this fix involves buffering/offsetting the polygon. Since implementing offsetting algorithm is not trivial, Clipper(<a href="http://www.angusj.com/delphi/clipper.php" class="remarkup-link" target="_blank" rel="noreferrer">http://www.angusj.com/delphi/clipper.php</a>) library was used so as to provide the buffer functionality.</p>
<p>The loss in detail of merged buildings was due to precision problems in QPolygonF::united() <br />
This was fixed by scaling the nodes of the polygon by a factor of 10000000 and then scaling them down by the same factor.</p>
<p>However, the 3rd problem - loss of some buildings in the final output still persists and in fact has been aggravated by the buffering. Since merging the buildings now involves buffferings, some of the buildings get merged with their neighboring buildings but when the merged polygon is buffered negatively, it results in loss of buildings.<br />
I have tried to correct this by testing the algorithm for different scale values taken for buffering but still this problem persists.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rMARBLE Marble</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D2376?vs=5752&id=5914" rel="noreferrer">https://phabricator.kde.org/D2376?vs=5752&id=5914</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D2376" rel="noreferrer">https://phabricator.kde.org/D2376</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/3rdparty/polyclipping/CMakeLists.txt<br />
src/3rdparty/polyclipping/clipper.cpp<br />
src/3rdparty/polyclipping/clipper.hpp<br />
src/CMakeLists.txt<br />
tools/osm-simplify/BuildingBlock.cpp<br />
tools/osm-simplify/BuildingBlock.h<br />
tools/osm-simplify/BuildingCluster.cpp<br />
tools/osm-simplify/BuildingCluster.h<br />
tools/osm-simplify/BuildingDensityClustering.cpp<br />
tools/osm-simplify/BuildingDensityClustering.h<br />
tools/osm-simplify/BuildingMerger.cpp<br />
tools/osm-simplify/BuildingMerger.h<br />
tools/osm-simplify/CMakeLists.txt<br />
tools/osm-simplify/main.cpp</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>tandon, rahn, nienhueser<br /><strong>Cc: </strong>nienhueser, Marble, marble-devel<br /></div>