Qgis Join Split Merge

Join Attributes by Location

Why do you want to join attributes by location?
You have two layers – a .shp file with the map, and a points layer. You would like them to become one layer. “Join additional attributes to vector layer based on spatial relationship. Attributes from one vector layer are appended to the attribute table of another layer and exported as a shapefile.”

How would you do that?
The easiest way to join attributes by location is to enable the “Join attributes by location” plug-in under data management tools.

Join1.png

Notice that I have a points layer, and a census tract layer. I would like to join the two together so the attribute table shows information about both in one table.

You will then want to set the out path, and decide where to save your new file. In this example I joined the census tract information to the coordinating farmer market points for Butte County.

It will prompt you telling you that it will be added to the Table of Contents, click yes. It will also prompt you saying you may lose information, click okay. By losing information, only the overlapping information between the points and the census data will be saved.

Join2.png

You can see in the image above, the yellow dots are now the new layer called MarketAndMap” and the attribute table includes the census tract location and numbers.

join3.png

If I were to join the opposite – the Census Tracts to the Markets it results in the following layer and attribute table.
The purple shapes are the census tracts which include a farmers market point.
This is a very useful tool in highlighting the locations of points and if they cluster in certain tracts.

Resources:
http://www.qgis.org/en/docs/user_manual/plugins/plugins_ftools.html#analysis-tools
http://maps.cga.harvard.edu/qgis/wkshop/join_spatial.php

Split Vector Layer

Why split a vector layer?
“Split input layer into multiple separate layers based on input field.”

How would you do that?
The easiest way to split a vector layer is to enable the “split vector layer” plug-in under data management tools. Once you have enabled this plug-in follow these steps.
I begin by opening up my census tract which includes income information for the residents of Butte County.
Split1.png
Once I have added this layer I go to Vector Data Management Tools  Split Vector Layer

Split2.png

I am then given an information box to fill out the information requested.

Split3.png
I chose my Butte County Census tracts as the layer I would like to split, and then the field I wanted to split was Medium Income for 2010. This means that when I hit “OK” I will be given a series of layers based on income of Butte County for 2010.
When saving the new files, you choose a file to save them in, you do not give it a name to save as. Once it is saved you must go to that file, and then add the layers to your map.
Split4.png

This is the result of the new layers. Each color and layer represents a different median income for the given census tract. This is a good tool to use if you are wanting to identify where a certain feature may be located across communities, cities, states, or nations.

Resources: http://www.qgis.org/en/docs/user_manual/plugins/plugins_ftools.html#analysis-tools

Merge Shapefiles into One

Why merge Shapefiles?
“Merge several shapefiles within a folder into a new shapefile based on the layer type (point, line, area).” This would be used for many reasons including merging information from various databases into one file to be layered on a census tract.

How would you do that?
Add two of the same file types that are located in the same folder – for me I added my Butte County Census Tracts and my Butte County Parcel layers to my map. Then go to Vector  Data Management  “Merge Shapefiles to One.”
You will be prompted for the name of the folder you will like to place the new layer in, and the name of the new layer. You then choose layers you would like to merge. Press okay – it could take up to a minute to process and merge the files. The new attribute table will then have all the information of the census tracts and the parcel information merging it into one layer.
Merge1.png