Skip to content

Instantly share code, notes, and snippets.

@dominijk
Last active June 23, 2017 12:52
Show Gist options
  • Save dominijk/13c7cf17a6b30ddd58d560c51b1ebe34 to your computer and use it in GitHub Desktop.
Save dominijk/13c7cf17a6b30ddd58d560c51b1ebe34 to your computer and use it in GitHub Desktop.
QGIS Helpful Expressions & rules
--Apply in the 'Label with' part of the properties
if( $area > 1600, "field_name_for_the_label" , None)
if( $area > 80000, regexp_replace( "name",'[(](.*)?[)]','' ) , None)
-- which means if the calculated area (project settings) is over then use the "name" column to label if not then no label,
--also strips anything within a bracket from the label
--Apply in the label size field from the expressions button
CASE WHEN $area > 100000 THEN 15 ELSE 7.5 END
--which means if area is bigger than this give it larger label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment