Saturday, 30 April 2016

Aligning existing polygon borders using QGIS?


I'm looking for a method to align the borders of two overlapping and already existing polygon layers. I'm aware of the node tool and its tolerance snapping option, but the area I'm working with is too large to do it manually.


I have two polygon layers. Layer 1 contains about 11,000 municipality features. Layer 2 contains 14 climatic zones (colored in picture 1).


Two layers with precise municipality features and unprecise climate zone features


As seen in picture 2 the outer border of the two layers do not fit. First of all I would like to manipulate the outer border of the climate zone layer (colored) so that it aligns with the outer border of the municipality features. Further I do not want the climate zone features to split the municipality features. One municipality shall be covered by only one climate zone.


Detail: Outer borders are not aligned. Some municipalites are intersected by the climate zone layer


At the very end I plan to intersect the two layers so that I have a list: Municipality ID to climate zone ID.



So far I only found a tool for ArcGIS, called Align to Shape.


Is something like this available for QGIS too?



Answer



Offhand I don't know of a QGIS tool that does it, but I have a couple of ideas on how to tackle the problem.


One possible workflow, though not automatic, would be to dissolve all municipal to a temp polygon, then clip the climate data using that. This would eliminate the exterior overlaps and leave only the interior gaps, which would be fewer problems to address. You could then intersect the two and join the result back to municipal to transfer the climate attributes back to unmodified municipals, thus preserving the areas that get dropped in the intersect.


That doesn't address the interior climate borders though. A possible solution to that (which also disregards the above) would be to convert the municipals to centroids, intersect the centroids with climate, then join the result back to municipals to assign the climate attributes. The consideration here is how split municipals will be handled. First you'd want to make sure you constrained the centroids so they were point inside (not necessarily true centroids). Then you have to decide if you can live with or need to check for cases where the majority of the municipal falls in one climate but the 'centroid' falls in another. Assuming you want to use a majority rule assignment that is.


Yet another possibility might be a Spatial Join constrained to a one-to-one match.


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...