Skip to content

Instantly share code, notes, and snippets.

@CEZERT
Created May 15, 2024 09:24
Show Gist options
  • Save CEZERT/3d4f5d7ff7a80feb02021c098426937f to your computer and use it in GitHub Desktop.
Save CEZERT/3d4f5d7ff7a80feb02021c098426937f to your computer and use it in GitHub Desktop.

Afficher stst des lignes par rapport des polygones

"nom_com" || '_' ||  "CODE_INSEE"  ||  '\n'  ||  '\n'  || 
to_string(round(coalesce(aggregate(
	layer:='stat',
	aggregate:= 'sum',
    expression:=$length,
    filter:=(
        "ft" LIKE '%_DET_DETECT%' AND length(intersection($geometry, geometry(@parent))) / length($geometry) > 0.5
    )
), 0), 2)) || ' m ----- Detection OK ---' || '\n' ||
to_string(round(coalesce(aggregate(
    layer:='stat',
    aggregate:='sum',
    expression:=$length,
    filter:=(
        "ft" LIKE '%_DETECTION_PERT%' AND length(intersection($geometry, geometry(@parent))) / length($geometry) > 0.5
    )
), 0), 2)) || ' m ----- Perturbée ---' || '\n' ||
to_string(round(coalesce(aggregate(
    layer:='stat',
    aggregate:='sum',
    expression:=$length,
    filter:=(
        "ft" LIKE '%INACCESSIBLE%' AND length(intersection($geometry, geometry(@parent))) / length($geometry) > 0.5
    )
), 0), 2)) || ' m ----- Inaccessible ---' || '\n' ||
to_string(round(coalesce(aggregate(
    layer:='stat',
    aggregate:='sum',
    expression:=$length,
    filter:=(
        "ft" LIKE '%CULTURE%' AND length(intersection($geometry, geometry(@parent))) / length($geometry) > 0.5
    )
), 0), 2)) || ' m ----- Zone culture ---'|| '\n' ||
'- ' || to_string(round(coalesce(aggregate(
    layer:='stat',
    aggregate:='sum',
    expression:=$length,
    filter:=(
        "ft" LIKE '%TRADI%' AND length(intersection($geometry, geometry(@parent))) / length($geometry) > 0.5
    )
), 0), 2)) || ' m ----- Tradi à faire ---'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment