20/07/2012

When to and not to use "Union"?

Road layer
Rail layer
Union layer 1
Bustop layer
Union layer 2

When to and not to use "Union"?

A Union tool under Vector/Geoprocessing tools is used to merge 2 separate layers, yes? Not really...er yes and no. What!? Answers like that people do not like. The novice who started to use a GIS software without reading the QGIS User Guidee will be wondering why. Then again if you did check the QGIS User Guide under fTools Plugin, there isn't any proper explanation how to use it (Room for improvement here!). You can see from the above, using the Union tool, the road and railway layer above could be made to merge as one although the moment they did, earlier customized properties disappeared and they reverted to the default setting. Gulp. This means much needed amendment if  you wanted it to look as before the union (Mmm...another room for improvement here). Secondly, when the road and bustop layers were unionized, the road layer did not appear. Why? Give up? (I want to win....give me a chance) Well, the reason is simple: apples and oranges do not mix. The road and rail layers were built on the same line architecture thus are compatible for unionizing whereas the bustop layer was built on the point architecture so line and point layers are incompatible for unionizing. If you did not know this, you will be cracking your head and cursing QGIS. Having pointed this out, I later did another experiment this time unionizing polygon and polygon layers but got baffled with the result and until now, I have not been to address the following issue:

Layout layer
Study area layer
Overlayed
Union layer
The layout layer consists of 647 features and the study area consists of 27,019 features. After unionizing the layout and study area layer,  I was expecting 27,666 features +/- a few features (who knows) but the union layer consist of 64,144 features (2.3 times more than 27,666 features). How did that come about? I am puzzled. Any advice is most welcomed.

4 comments:

  1. The concept of union is where polygon overlap new polygon will be created. The table will then be joint. That's why the number of polygons increased.

    ReplyDelete
    Replies
    1. Agreed that was why I was expecting an increase in the number of polygons but only to the total of 27,666. This does not answer why the union resulted in 64,144 polygons.

      Delete
  2. Well, if you union two intersecting lines you will get four features as a result. The intersection point divides the lines. Same applies to polygons.

    ReplyDelete
    Replies
    1. Ah...you are right. Sometimes, there is a tendency to find answers in GIS with a fine tooth comb only to realize later that one was standing too close to see the elephant. Thanks

      Delete