YSLD can be a bit hard to explain as several of the concepts ("rule" and "feature-style") do not have explicit representations since they are recorded in list form. Symbolizers are much easier to explain as they are always represented as "point", "linestring","polygon","raster","text". name synonyms I would like to request that: "rule: xxx" act as syntatic sugar for "name: xxx" "feature-style: abc" act as syntatic sugar for "name: abc" This adds no more complexcity, is backwards compatible and is much easier to follow. Example from the YSLD Reference: rule: all title: Every feature will be styled this way symbolizers:
- polygon:
fill-color: '#808080' fill-opacity: 0.5 stroke-color: '#000000' stroke-opacity: 0.75
Example from the YSLD Reference: feature-styles:
- rules:
- rule: close
scale: [min,50000] symbolizers:
- line:
stroke-color: '#000000' stroke-width: 2
- rule: far
scale: [50000,max] symbolizers:
- line:
stroke-color: '#000000' stroke-width: 1
Tags Kevn has suggested using tags to handle this story: Example from the YSLD Reference: !rule name: all title: Every feature will be styled this way symbolizers:
- polygon:
fill-color: '#808080' fill-opacity: 0.5 stroke-color: '#000000' stroke-opacity: 0.75
Example from the YSLD Reference: feature-styles:
- rules:
- !rule
name: close scale: [min,50000] symbolizers:
- line:
stroke-color: '#000000' stroke-width: 2
- !rule:
name: far scale: [50000,max] symbolizers:
- line:
stroke-color: '#000000' stroke-width: 1
Consistent Tags If we did the tag approach from the start we could of avoided single element mapping as shown here: !feature-style rules:
- !rule
name: close scale: [min,50000] symbolizers:
- !line
stroke-color: '#000000' stroke-width: 2
- !rule:
name: far scale: [50000,max] symbolizers:
- !line:
stroke-color: '#000000' stroke-width: 1
This would reduce the amount of nesting, but result in a longer file. |