I'm struggling to find a way to identify all the points within certain contour intervals. I have a raster dataset that I generated a contour map from. Within the region of interest, I have a specific area where I have circular contours that are enclosed (no dangling ends). I created a new polyline shapefile from the selected contours I am interested in, and converted that new polyline shapefile into a polygon shapefile.

I created the polygon shapefile because I couldn't query points within a polyline shapefile. Because these are circular contours centered around a certain high elevation point, these contours sit inside each other and form a sort of bullseye pattern.

When I try to do a spatial query, I select the largest contour polygon and try to query which points are within this contour, but I also want my query to ignore all the points that are within the other successive contours, but the spatial query highlights all points within that contour interval as well as all the other points in the contours above it. I figure that the QGIS "line to polygon" tool treated the circular contours as circular areas rather than a "doughnut" style polygon, where the next contour interval line would act as the inside boarder.

When I look at the options within the spatial query, I can not find a way to indicate that I want points "WITHIN" a polygon "AND" points "OUTSIDE/WITHOUT" another polygon. Does anyone have any ideas on how I might be able to perform this spatial query?

I apologize if this question was asked previously.

1 Answer 1


Before doing your spatial query, consider editing first the polygons you've created by "making holes" within them. You can do this by using the "Add Ring" tool from the Advanced Digitizing toolbar and digitize a hole for each polygon, the hole being the contour immediately above it. The result would be a "doughnut" polygon for that contour interval. After that, do your spatial query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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