- Get the nearest point on layer
airports: useoverlay_nearest()with the optional argumentlimit:=1. Do the same for layer harbors. You might also add amax_distance()argument. - Combine both nearest points with
union() - Get the closest point to your input out of these two points using
closest_point().
The whole expression to do so:
closest_point( union( overlay_nearest ( 'airports', @geometry, limit:=1, max_distance:=1000 )[0], overlay_nearest ( 'harbors', @geometry, limit:=1, max_distance:=1000 )[0] ), @geometry ) closest_point( union( overlay_nearest ( 'airports', @geometry, limit:=1, max_distance:=1000 )[0], overlay_nearest ( 'harbors', @geometry, limit:=1, max_distance:=1000 )[0] ), @geometry ) Screenshot: yellow points 1 and 2 each have either athe closest airport or harbor within max. 1000 m, marked with a black ring, created by the expression above; point 3 does not have within 1000 m any harbor or airport:
