I am new to QGIS and need to know how to extract names and address' from the points in certain polygons. My main layer has all the points on the maps and then I drew the polygons on the map. I then counted all the points in the polygons and that has all worked fine but now i need to know the names and address' in the polygons. It is probably a simple fix but I have tried for a day and cannot figure it out. It has to be something in the attributes table and joining the information but I am lost.
-
4Possible duplicate of Spatial Join in QGIS 2.2– KingfisherJan 25, 2019 at 13:46
-
What do you want your output to look like?– KingfisherJan 25, 2019 at 13:49
-
Either a csv or table would be fine. Just something i can print– Jamie PrattJan 25, 2019 at 13:57
-
This is NOT a duplicate of gis.stackexchange.com/questions/98293/spatial-join-in-qgis-2-2. The suggested duplicate question has a misleading title; it's actually about a very specific case where a spatial join didn't work. The answer doesn't explain how do a spatial join.– cskJan 25, 2019 at 18:58
2 Answers
You can use the point sampling plugin to assign your polygon values to your points. This will result in a new shapefile and then if you want just the attribute data you can right click on the new layer in the Layers Panel and choose 'Export' -> 'Save Features As...' -> then choose .csv.
Do a spatial join.
The QGIS tool for a spatial join is called Join Attributes by Location. Find it in the Vector menu > Data Management section.
Since you only need the joined table and not the geometries, it doesn't matter which layer is the input and which is the join layer. Choose "one-to-many" join type.
Export the joined layer to CSV format, which you can open as a spreadsheet. Or you can select the entire attribute table and paste it into a spreadsheet.
There's a spatial join tutorial here if you want more details/explanations/screenshots.