0

Complete newbie to QGIS and can't seem to find how to do this.

I have created a map with 84 different polygons. Then I've imported approx. 8000 points.

What I want to do is now query my map and get it to tell me the polygon each Point is in and then be able to extract this into a text or CSV file.

Can anyone help?

2

1 Answer 1

1

I do not have access to QGIS on this CPU but, I would like to propose an alternate solution.

You can perform the analysis in QGIS but if you are only interested in the report, writing SQL is more efficient.

You will need access to the data and access to SQL Server, you can derive the information via a simple SQL query. Other SQL providers such as PostGRESQL and MYSQL will support similar functions.

This query will list the Hydrant and Fire District IDs along with common identifiers and the geometry definition of each. Because it has the geometry defined, if you were to insert these results into a table you can then review them in your map.

SELECT WHYDRANT.OBJECTID AS HYDID,
    WFIREDISTRICT.OBJECTID AS FDID, WHYDRANT.UNID AS UNID,
    WFIREDISTRICT.UNID AS FDUNID, WHYDRANT.SHAPE
FROM WFIREDISTRICT 
    INNER JOIN WHYDRANT ON 
        WFIREDISTRICT.SHAPE.STContains(WHYDRANT.SHAPE()) = 1