Visibility scaling for UDDF import

Visibility is defined in meters in UDDF and we use scale up to 5 stars.
Thus the meters are scaled to our star rating using one-size-fits all
method.

< 1m => 1 star
<= 3m => 2 star
<= 5m => 3 star
<= 10m => 4 star
> 10m => 5 star

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2013-06-09 07:47:52 +03:00 committed by Dirk Hohndel
parent 72d0030509
commit 9066c8bad6

View file

@ -128,7 +128,23 @@
<xsl:if test="condition/visibility != '' and condition/visibility != 0">
<xsl:attribute name="visibility">
<xsl:value-of select="condition/visibility"/>
<xsl:choose>
<xsl:when test="condition/visibility &lt; 1">
<xsl:value-of select="1"/>
</xsl:when>
<xsl:when test="condition/visibility &lt;= 3">
<xsl:value-of select="2"/>
</xsl:when>
<xsl:when test="condition/visibility &lt;= 5">
<xsl:value-of select="3"/>
</xsl:when>
<xsl:when test="condition/visibility &lt;= 10">
<xsl:value-of select="4"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>