Wednesday, 14 September 2016

qgis - Merge intersecting polygons into one which are part of the same feature


I'm not a GIS professional so I hope I use the correct wording, at least I hope you understand my question.


Let's say there are five polygons in the feature A. In the shapefile there are more features. In feature A two polygons from the five existing are intersecting. I want to merge the two so overlapping lines will be deleted and the result is one polygon.


A possible solution would work like this:




  • I select the feature which 'activate' all five polygons

  • I switch to edit mode

  • I select the points of the two polygons

  • I use function MERGE-SELECTED-POLYGONS


So far I found only functions to merge objects (features?), merge shapefiles, and so on.


Is there a function MERGE-SELECTED-POLYGONS?



Answer



There's a couple of ways of going about this but you probably want to dissolve the features (Vector->Geoprocessing Tools->Dissolve). With dissolve you don't need to select anything first as it is all done from the attributes. So, let's say you have a field called 'Type' (for example). Then in your example your polygons would all be type 'A' (and you could have some other polygons of type 'B' which you don't want to join with ones of type 'A'). If you select the 'Type' field (or other appropriate attribute in your case) as the attribute to dissolve on then all features of the same type will join together (internal boundaries will be dropped). This may well result in a multipolygon (a single feature which has more than one part, like an archepelago), which might or might not be acceptable. If it is undesirable then simply split the feature up into its constituent polygons by using Vector->Geometry Tools->Multipart to Singlepart.


The alternative is to buffer your polygons by zero, but this probably will join polygons of different types together where you don't want it to happen, so dissolve (optionally follwed by multipart to single part) is safer.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...