3

I need to locate where different polygons (buffer rings) from different layers are intersected based on a same attribute value. As shown in the figure, there are different buffer rings from different layers (blue, red and black) at different distances with a different attribute values in every ring, let's say for example 'temperature' values.

enter image description here

Is it possible to make a spacial query to select where same temperatures values from the different buffer rings are intersenting? I mean, for example, where the 3°C buffer ring of every layer are intersecting.

Spacial query just interacts with whole layers not specific parts of them.

3

Select the polygons with the specified temperature value in each layer. Run the Intersection tool the first two layers. Intersect the output with the next layer. Repeat until you've used all the layers. The final output will be the area of overlap between the selected features in all the layers.

  • It works, but I think it wouldn't be practical with several layers. To this should be added the same analysis for other temperature rings. It would be an ardous task. Could it be possible to make this same analysis but yielding the areas for the whole range of temperatures in the attribute table of both layers? – GisAmateur Feb 18 at 9:33
  • What do you mean by "whole range of temperatures"? I thought you wanted to consider each temperature separately. I'm not sure what your actual question is, but perhaps you want to merge the layers into one layer, then dissolve by attribute. – csk Feb 19 at 16:55
  • It would be similar like this gis.stackexchange.com/questions/86308/… The diference is that I don't need every single intersection but only the intersections with the same attribute value. – GisAmateur Mar 14 at 11:24
2

For more flexible spatial queries you can Create a Virtual Layer with the SQL query that you need.

For example, to join in a table the features of the three layers that have the same "temp" attribute, and perform the intersection between their geometries, your can use the following query:

SELECT 
    ST_Union( 
        ST_Intersection( 
            red_lyr.geometry, 
            ST_Intersection( 
                blue_lyr.geometry, 
                black_lyr.geometry))) AS geometry, 
    red_lyr.temp AS temp 
FROM 
    red_lyr 
    INNER JOIN 
        blue_lyr 
        ON red_lyr.temp = blue_lyr.temp
    INNER JOIN 
        black_lyr 
        ON red_lyr.temp = black_lyr.temp   
WHERE 
    ST_Dimension( 
        ST_Intersection( 
            red_lyr.geometry, 
            ST_Intersection( 
                blue_lyr.geometry, 
                black_lyr.geometry))) = 2 
GROUP BY red_lyr.temp

The WHERE condition of ST_Dimension() = 2 is to filter by intersections that return polygons.

EDIT: Using ST_Union() to return just one feature for each "temp" value.

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.