osmeditor4android
osmeditor4android copied to clipboard
Data styling issue with the natural rules and closedways
Vespucci Version
17.0.1
Behaviour/Symptoms
Because of the definition of the styling for way with the key "natural", the rules for cliff / tree_row / coastline will never apply if it is a closedway. (As far as I know, tree rows can also be mapped as closed ways, e.g. in a small park. The same perhaps with cliff and even coastline – small islands?).
Here the second rule will always match (and win over the following rules) if a way is a closedway, but it contains only a rule for natural=water:
<feature type="way" tags="natural" updateWidth="true" widthFactor="0.5" color="ff71BE80" style="STROKE" cap="BUTT" join="MITER">
<feature type="way" tags="natural" closed="true" area="true" pathPattern="border_right" >
<feature type="way" tags="natural=water" widthFactor="1.0" minVisibleZoom="10" color="ff0000ff" />
</feature>
<feature type="way" tags="natural=water" widthFactor="1.0" minVisibleZoom="10" color="ff0000ff" />
<feature type="way" tags="natural=cliff" widthFactor="2.0" color="ff555555" pathPattern="triangle_right" />
<feature type="way" tags="natural=coastline" widthFactor="2.0" minVisibleZoom="10" color="ff71BE80" pathPattern="triangle_left" />
<feature type="way" tags="natural=tree_row" widthFactor="2.0" color="ff4b7a54" cap="ROUND" />
</feature>
It could be like that:
<feature type="way" tags="natural" updateWidth="true" widthFactor="0.5" color="ff71BE80" style="STROKE" cap="BUTT" join="MITER">
<feature type="way" tags="natural=cliff" widthFactor="2.0" color="ff555555" pathPattern="triangle_right" />
<feature type="way" tags="natural=coastline" widthFactor="2.0" minVisibleZoom="10" color="ff71BE80" pathPattern="triangle_left" />
<feature type="way" tags="natural=tree_row" widthFactor="2.0" color="ff4b7a54" cap="ROUND" />
<feature type="way" tags="natural" closed="true" area="true" pathPattern="border_right" >
<feature type="way" tags="natural=water" widthFactor="1.0" minVisibleZoom="10" color="ff0000ff" />
</feature>
<feature type="way" tags="natural=water" widthFactor="1.0" minVisibleZoom="10" color="ff0000ff" />
</feature>
Or like that perhaps:
<feature type="way" tags="natural" updateWidth="true" widthFactor="0.5" color="ff71BE80" style="STROKE" cap="BUTT" join="MITER">
<feature type="way" tags="natural=water" closed="true" area="true" pathPattern="border_right" widthFactor="1.0" minVisibleZoom="10" color="ff0000ff" />
<feature type="way" tags="natural=water" widthFactor="1.0" minVisibleZoom="10" color="ff0000ff" />
<feature type="way" tags="natural=cliff" widthFactor="2.0" color="ff555555" pathPattern="triangle_right" />
<feature type="way" tags="natural=coastline" widthFactor="2.0" minVisibleZoom="10" color="ff71BE80" pathPattern="triangle_left" />
<feature type="way" tags="natural=tree_row" widthFactor="2.0" color="ff4b7a54" cap="ROUND" />
</feature>
By the way: for rendering a even nicer tree row line, you could also use the following styling – it looks like a dotted line with thick dots and a very thin line connecting them (like a string of pearls). I use it in my personal data styling for Vespucci ... And it helps to better identify tree rows on the map ...
<feature type="tree_row_casing" updateWidth="true" widthFactor="0.2" color="ff037100" style="STROKE" cap="BUTT" join="MITER" />
<feature type="way" tags="natural=tree_row" widthFactor="2.5" color="ff146824" cap="ROUND" join="ROUND" casingStyle="tree_row_casing" labelZoomLimit="20">
<dash phase="1.0">
<interval length="0.05" />
<interval length="2.0" />
</dash>
</feature>
Looks like that:
In case it isn't clear: the way to get this done is to create a pull request so that I can test directly instead of having to to recreate everything that you have done.