Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow expressions in LABEL PRIORITY (#6884)
* Allow expressions for LABEL PRIORITY * Add msautotest images * Add check for duplicate PRIORITY
- Loading branch information
1 parent
497ba5d
commit db74212
Showing
7 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# RUN_PARMS: label_priority_binding.png [MAP2IMG] -m [MAPFILE] -l label_priority_binding -o [RESULT] | ||
# RUN_PARMS: label_priority_fixed.png [MAP2IMG] -m [MAPFILE] -l label_priority_fixed -o [RESULT] | ||
# RUN_PARMS: label_priority_expression.png [MAP2IMG] -m [MAPFILE] -l label_priority_expression -o [RESULT] | ||
# | ||
# Test label priorities | ||
# | ||
|
||
MAP | ||
IMAGETYPE "png" | ||
SIZE 400 400 | ||
EXTENT -.5 -.5 1.5 1.5 | ||
FONTSET "../misc/fonts.lst" | ||
PROJECTION | ||
"init=epsg:4326" | ||
END | ||
LAYER | ||
NAME "label_priority_fixed" | ||
TYPE POINT | ||
STATUS OFF | ||
DATA "data/label_alias_offset.shp" | ||
LABELITEM "label" | ||
CLASS | ||
# make sure pnt7 gets labelling priority | ||
EXPRESSION ([priority] = 7) | ||
LABEL | ||
FONT "default" | ||
TYPE TRUETYPE | ||
SIZE 40 | ||
COLOR 0 0 0 | ||
PRIORITY 10 | ||
END | ||
END | ||
CLASS | ||
EXPRESSION ([priority] != 7) | ||
LABEL | ||
FONT "default" | ||
TYPE TRUETYPE | ||
SIZE 12 | ||
COLOR 0 0 0 | ||
PRIORITY 1 | ||
END | ||
END | ||
END | ||
LAYER | ||
NAME "label_priority_binding" | ||
TYPE POINT | ||
STATUS OFF | ||
DATA "data/label_alias_offset.shp" | ||
LABELITEM "label" | ||
CLASS | ||
LABEL | ||
FONT "default" | ||
TYPE TRUETYPE | ||
SIZE 12 | ||
COLOR 0 0 0 | ||
PRIORITY [priority] | ||
END | ||
END | ||
END | ||
LAYER | ||
NAME "label_priority_expression" | ||
TYPE POINT | ||
STATUS OFF | ||
DATA "data/label_alias_offset.shp" | ||
LABELITEM "label" | ||
CLASS | ||
LABEL | ||
FONT "default" | ||
TYPE TRUETYPE | ||
SIZE 12 | ||
COLOR 0 0 0 | ||
# add a duplicate PRIORITY that will be ignored | ||
# but check it is cleaned up correctly | ||
PRIORITY ([priority] * 2) | ||
# use an expression to invert the label priorities | ||
PRIORITY (10 - [priority]) | ||
END | ||
END | ||
END | ||
END |