By using Rule based layer styling for a polygon shapefile I want to display only those features whose centroid is separated by 1.000m from the feature centroids of another polygon layer ('layerB'). The following filter expression is invalid and I cannot understand why:
distance(centroid($geometry), centroid(geometry('layerB_011018_5154ef48_b1da_43ae_91b9_daeb20f6cab9'))) > 1000
Getting the feature geometries from 'layerB' is probably the problem here. The geometry
operator doesn't seem to fetch all feature geometries from a 'layerB'. How can I solve this?
geometry()
has one argument: it expects a feature as input. However, you set a layer as input. that cannot work. Honestly I don't quite understand how your solution should look like: can you post a screenshot? Rule based style on layer A if distance to which centroid(s) of layer B? All of them? The closest one?geometry()
, that wasn't clear to me yet.geometry()
) in the middle, on the right side you see the help where you see exactly what kind of input (arguments) the functions expects. By the way: Make it clear if you still look for an answer or if the answer by @MrXsquared solved your problem (by accepting it). If not, give some information what you're missing - otherwise, it's difficult to guess. And: any substantial clarification about your problem should be included in the initial question by editing not - not in comments here.