2

I want to do rule based styling for a selection of gridded polygons dependent on their position relating to another layer. I want to show the polygon that a point feature based in an atlas falls within which I have managed with

intersects($geometry,@atlas_geometry)

The tougher bit is that I also want to show the 8 grid boxes that surround the central grid box in another style. Unfortunately, as the grid is rectangular, not square, I cannot just use a buffer of the atlas feature as when the feature is close to the edge it will show features to the east/west before north/south. I have tried using nested intersections such as

intersects($geometry,intersects($geometry,@atlas_geometry))

but no luck so far. I want to do this dynamically so it shows just the grid surrounding the atlas feature and without having to create any more new layers.

enter image description here

enter image description here

2

Your objection to buffering only applies to the point. It would not be a problem if you buffer the polygon that you have just found. Also, instead on doing a buffer operation followed by and intersects, why not search in a single step with "touches" based on the red rectangle?

  • Not sure I understand what you mean, the red rectangle is not a separate shapefile, it just styled based on the rule intersects($geometry, @atlas_geometry) I've tried using touches($geometry,intersects($geometry, @atlas_geometry)) in the hope that it will select all the boxes that touch the intersected box but it doesn't seem to be working as I would hope. – C Goode Dec 13 '18 at 8:55

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.