I have a list of our sales lead locations in Excel with their coordinates.
What I wish to do is that I need to sort those coordinates as per the condition if they lie within a certain polygon or not. So suppose I have two polygons for two cities then I need to mark the coordinates in the sheet like they’re in polygon 1 or 2 or NIL.
I had been doing this manually in QGIS by selecting the points outside polygons and deleting them and then exporting and then again sorting the sheet but this is now taking a lot of time since the number of entries is increasing.
Could someone suggest a better, simpler and quicker way to do this, irrespective of the method used? I don’t care if, as per your suggestion, it can be done in Excel itself, QGIS, or with the help of some other software. I need to mark in the next column to which polygon the coordinates belong.
Best Answer
I mocked up some input data similar to yours, and loaded it as Lat/Lon using Add Layer -> Add Delimited Text Layer...:
I loaded a layer of Indian states/territories since I don't have your particular polygon data:
I then used the Field Calculator to add a Polygon field of output type = Text using the following expression.
overlay_intersects('Indian_States',"Name",limit:=1)[0]
Output seems to be what you are looking for: