2

New here but I've been following the stack exchange for a while to get many answers on my newbie journey in GIS. I'm trying to find out how to merge different point in polygon classes by column.

Anyhow, I have a land use map of a neighborhood in Chicago. I used the parcel information to create a point map showing all the different land use classes (0-4). From there I went on to create 5 different layers, each showing the parcels of a certain type using new layer by selected features.

Next I did a points in polygon spatial analysis to let me know how how much each land use type exists in a certain block. So I have 5 layers showing me the point count per block - each layer shows a certain type. What I'd like to do is merge the columns. I know I can probably do it by editing the csv/dbf files associated with the shapefile, but I'd like to know if there's a way to do this through QGIS. Also, if you feel like I was inefficient in the way I went about this, please don't hesitate to critique my methodology.

  • Just to clarify - you have 5 polygon layers representing blocks, all containing an attribute showing a count of points of a particular class? Do the blocks have a unique ID that is shared by all the 5 layers i.e. an ID per block polygon? – Ed Rollason Jan 27 '16 at 9:39
  • Yes - exactly. All the different blocks layers are based off the same original, but each with a different set of points in each block. So for example - One block has parcel points for residential use only, another has one for commercial only. I'd like to combine them into one layer essentially. All the layers have 210 fields with a unique ID. – Ali_Att Jan 27 '16 at 18:53
3

You could use the Join attributes by table tool from the Processing Toolbox which allows you to combine the attributes of 2 layers at a time using common field. So first you could do Layer1 and Layer2, then the output of this with Layer3 etc.

Or you can use the Merge Shapefiles to One tool from the toolbar (Vector > Data Management Tools > Merge Shapefiles to One) to combine all your layers in one go. This may create duplicate fields so you may want to edit the attribute table to remove these.

  • The Merge Shapefiles to One didn't work, it ended up adding an extra 750 - so that's a little too much cleaning up to do. I'll try the first method now and let you know what happens. – Ali_Att Jan 27 '16 at 17:46
  • @Ali_Att - Yes, the "Merge Shapefiles to One" tool can be a pain if you have a lot of attribute fields :) – Joseph Jan 28 '16 at 13:12
  • 1
    Just wanted to let you know that method number 1 worked. I tried this beforeand I always got NULL values for my joined columns. Turns out the unique IDs were all 0, and the file I was using was corrupt. So I just downloaded it again and everything worked out. Thanks. – Ali_Att Jan 29 '16 at 0:38
  • @Ali_Att - Awesome buddy, glad it worked! Good thing there was more than one copy of the shapefile :) – Joseph Jan 29 '16 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.