[Qgis-user] Removal of overlap geometries within the same layer - merge to largest neighbor polygon

Andreas Neumann a.neumann at carto.net
Wed Jul 26 23:27:44 PDT 2023


Hi Bernhard,

Ah - now I understand it - before feeding the polygons into the 
"Eliminate selected polygons" I should only select the overlapping ones 
detected by the Union (e.g. by using the "select by attribute" algorihm) 
- and not all polygons in the layer. Makes sense. The algorithm will 
then merge these subselects to their neighbours matching either largest 
or smalllest area or common boundary. Will give it a try.

Otherwise, the "eliminate selected polygons" sounds interesting in more 
"interactive", semi-automated workflow.

Thanks,

Andreas

On 2023-07-26 15:22, Bernhard Ströbl via QGIS-User wrote:

> Hi Andreas,
> 
> I would like to give some explanations on your comment concerning the 
> eliminate algorithm: During development the goal was to have a method 
> that can get rid of sliver polygons (I explained my workflow for 
> detecting them in my previous post). The algorithm simply merges the 
> selected polygons with their specified neighbours. The attribute values 
> of the neighbour stay as they are. What would you expect attributewise? 
> Furthermore no definition of the polygons to eliminate is defined in 
> the code thus it is up to the user to decide which polygons should go, 
> hence it works on the selection. Making a tool that merely eliminates 
> all overlaps would be a different task. The eliminate tool as it is has 
> a broader use range, examples: You can only eliminate certain overlaps 
> while keeping others. You can use it to generalize by getting rid of 
> polygons smaller than a certain size. You have landuse data that 
> contains polygons for a river but you want to use lines for the river, 
> so get rid of all river polygons....
> 
> regards
> 
> Bernhard
> 
> Andreas Neumann via QGIS-User <qgis-user at lists.osgeo.org> hat am 
> 26.07.2023 14:15 CEST geschrieben:
> 
> Hi,
> 
> Thank you all for your feedback!
> 
> @Nyall - the GEOS/JTS capabilities for cleaning and validating 
> geometries
> look definitely interesting. Something for an upcoming QGIS-CH grant
> perhaps ...
> 
> @Bernhard - I also had a look at and tested the "Eliminate selected
> polygons" algorithm - but it doesn't have a way to specify attribute
> handling nor grouping - and it is also strange that I have to select 
> the
> polygons first and cannot run the algorithm on the whole data set as is
> 
> About SAGA: I couldn't get the SAGA stuff to work anymore
> About GRASS: it could be an option, but a native solution in QGIS would 
> be
> preferred
> 
> So in summary: there are several options around for cleaning overlaps - 
> but
> it isn't as straight-forward and user friendly yet as it could/should 
> be.
> 
> I haven't looked at the gaps yet ...
> 
> Thank you all and greetings,
> Andreas
> 
> On Tue, 25 Jul 2023 at 13:13, Bernhard Ströbl via QGIS-User <
> qgis-user at lists.osgeo.org> wrote:
> 
> Hi Andreas,
> 
> the Algorithm "Eliminate selected polygons" was originally created to
> address these questions. I usually imported the data into GRASS ran a 
> clean
> there and reexported the results into a non topolgical dataset. Thus
> overlapping areas and gaps (only if closed) are identified and can be
> eliminated using the algorithm named above (selecting only a certain
> area-circumference relation) by merging it with the adjacent polygon 
> with
> the smallest/largest area or the longest common boundary.
> For your case you could have used this algorithm after the union to
> identify overlaps.
> As for an algorithm that does all this in one go: You would need 
> something
> that detects holes between polygons without the help of a toplogical 
> data
> format.
> 
> regards
> Bernhard
> 
> Andreas Neumann via QGIS-User <qgis-user at lists.osgeo.org> hat am 
> 25.07.2023 12:01 CEST geschrieben:
> 
> Hi,
> 
> A friend of mine has a dirty input data set with lots of overlapping
> geometries (within the same layer) and asked me if there is a tool
> within QGIS to automatically remove the overlaps and assign the
> overlapping area to the neighbor polygon with the largest area.
> 
> The solution was surprisingly hard to find, although I am pretty sure
> there are multiple combinations of algorithms that would solve the
> problem. Here is the solution I came up with:
> https://github.com/qgis-ch/overlap_removal/tree/main [1]- perhaps you
> have better ideas - more elegant solutions?
> 
> Wouldn't it be great if QGIS had a processing tool to solve this 
> overlap
> cleaning within the same layer "out of the box" without having to use a
> graphical model or a more or less complicated sequence of algorithms in
> the processing toolbox? Apparently, ArcGIS has such a tool ...
> 
> Saga and GRASS also might have such tools - but I couldn't get the SAGA
> based QGIS plugin "Dissect and dissolve overlaps"
> (https://plugins.qgis.org/plugins/dissect_dissolve_overlaps).
> 
> The same problem exists for automatically filling small gaps in the
> polygon data set ...
> 
> Andreas
> 
> Links:
> ------
> [1] 
> https://github.com/qgis-ch/overlap_removal/tree/main_______________________________________________ 
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user 
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 

--
Andreas Neumann
QGIS.ORG board member (treasurer)
_______________________________________________
QGIS-User mailing list
QGIS-User at lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user 
_______________________________________________
QGIS-User mailing list
QGIS-User at lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230727/8d7fd360/attachment.htm>


More information about the QGIS-User mailing list