I am pretty green with GIS, however:

I have two data sets:

  • a shapefile defining various exclusive populated areas.
  • a text file defining the location of all telecommunications sites in a site

I would like to determine what area a particular site is in. Sample shapefile and points

I am using the Desktop version of QGIS 2.18.1

I already had the XY location data imported. However your solution gave me half the result I was looking for. I also used Difference tool to detail the sites not covered by a polygon.

  • Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. I recommend not thinking about GIS SE as being some sort of online GIS tutor. For your questions to be answered here they should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. What GIS software are you using? – PolyGeo Jan 8 '17 at 22:05
  • This is a trivial capability in any GIS package. We can't begin to recommend a solution until you specify the GIS software in use. If you take the Tour you may find helpful hints on how GIS SE works. – Vince Jan 8 '17 at 22:06
  • Zoltan commented "use overlay from processing toolbox" in this post gis.stackexchange.com/questions/222825/… – Matthew Edwards Jan 8 '17 at 23:17

Common QGIS approach would be "Join attributes by location", but my personal preference is SAGA geoalgorithm "Add polygon attributes to points" from Processing Toolbox. (This is a bit easier, I think.)

Processing Toolbox | SAGA | Vector point tools | Add polygon attributes to points

You will need to provide (1) your point shapefile and (2) Polygon shapefile and its attribute column (name of populated area, for instance).

Result is new point layer with the corresponding polygon name (or whatever attribute you chose) as a new field.

Please note this is in response to your "I would like to determine what area a particular site is in." as you've got the answers for "number of points" already.


Since you've got a shapefile for the populated areas, I'm going to go ahead and assume that is the polygon file and that you're using ArcGIS. The easiest option would be to use the Intersect tool.

Firstly, add your point text file:

  • Click File > Add Data > Add XY Data
  • Browse to your text file and select it
  • Specify the X and Y fields, as well as the coordinate system, then click OK
  • Right-click the new layer in the Table of Contents, select Data > Export Data
  • Name the output feature class and click OK. This will give you data with OIDs, which are required for the Intersect geoprocessing tool. Add the data to the display when prompted.

Add your polygon shapefile via your usual method - drag and drop etc.

Open Arc Toolbox. Browse to Analysis Tools > Overlay and double-click the Intersect tool.

  • Select your XY data from the Input Features box, then select your polygon data from the Input Features box.
  • Name your output features
  • Accept the other defaults and click OK

When the Intersect tool is finished, your new feature class will be in the Table of Contents. Open the attribute table and scroll to the end of the data. You will now have the attributes of your polygon data appended to the end of the table

Since I posted this answer the software has been identified as QGIS, so these steps won't resolve your issue. However, I will leave the answer here since others with a similar issue, but using ArcGIS, may find this question through search engine queries.

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.