Skip to content

Instantly share code, notes, and snippets.

@thbaumann
Forked from pigreco/minimum_distance.txt
Created March 19, 2021 13:16
Show Gist options
  • Save thbaumann/954f750ef53bf9c9f9136a7d726c6541 to your computer and use it in GitHub Desktop.
Save thbaumann/954f750ef53bf9c9f9136a7d726c6541 to your computer and use it in GitHub Desktop.
here is the expression used in the Default widget
if (
distance(
overlay_nearest(
layer:='poligono',
expression:= $geometry )[0], $geometry) <
distance(
overlay_nearest(
layer:='linea',
expression:= $geometry )[0], $geometry),overlay_nearest(
layer:='poligono',
expression:= "nomePoly" )[0],
overlay_nearest(
layer:='linea',
expression:= "nomeLinea" )[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment