[Tilesathome] Proposal temporay tags -- the solution?
Heiko Jacobs
jacobs at cousin.de
Fri Jan 30 19:26:31 GMT 2009
Hello
Second mail: "the solution?" :-)
I also put it in the wiki:
http://wiki.openstreetmap.org/wiki/Osmarender/Proposal_Temporary_Tags
In the first mail I described the problem, that is a result
of existing structure and capability of rules:
Large cascades of <rule><else>-decisions needed.
A lot of code is done double.
That doesn't make coding and support easy...
And everything similar for bridge casings, bridge cores,
standard casings, standard cores, tunnels, lines/areas, text, ...
I found the proposal
http://wiki.openstreetmap.org/index.php/Osmarender/NewFeaturesProposal
This may result in source code, where all is at the same place,
that belongs together.
But source code wouldn't be more simple...
And the proposal isn't available.
(Is anyone working to do it???)
I also found
http://trac.openstreetmap.org/ticket/1476
But I don't unterstand if it may help or not to simplify code.
I fear it doesn't help...
I just have anoter idea, that may help to simplify rules:
Temporary tags for OSM-elements
*******************************
Using it I can split the cascades from example, see other mail,
into 3 smaller cascades:
<rule width-c-onothercase>
<set k="$width" v="c" />
</rule><else>
<rule width-a>
<set k="$width" v="a" />
</rule><else>
<rule width-b>
<set k="$width" v="b" />
</rule><else>
<rule width-c>
<set k="$width" v="c" />
</rule><else>
<set k="$width" v="d" />
</else>
</else>
</else>
</else>
<rule firstoldcase>
<set k="$width" v="c" />
</rule>
<rule secondoldcase>
<set k="$width" v="a" />
</rule>
<rule narrow-width>
<set k="$narrow" v="narrow" />
</rule><else>
<set k="$narrow" v="wide" />
</rule>
<rule speciacaseone>
<set k="$spec" v="one" />
</rule><else>
<rule specialcasetwo>
<set k="$spec" v="two" />
</rule><else>
</else>
<set k="$spec" v="none" />
</else>
So every way that follows the rules got an extra tag,
that only exists while data is processing.
The "$" only should mark it as temporary and to avoid
conflicts with tags inside original data, that from now on
should start with an "$" :-)
As second step an easy way to refer them is needed.
Then the whole very large cascade from the mail with the example
is simplified to 3 lines:
<rule bridgecasing>
<rule way-type>
<line class="x-general x-{$spec} x-{$width}-{$narrow}" />
</rule>
</rule>
That's all for all cases of bridge casings!
And for bridge cores:
<rule bridgecore>
<rule way-type>
<line class="y-general y-{$spec} y-{$width}-{$narrow}" />
</rule>
</rule>
Standard casings may look a little bit different, if I
decide to choose different colors for other tag-combiniations,
so new temporary tags are needed, but it also would look simple
like the rules above...
I don't know, if thy syntax using {} is the best solution...
Someone, who has more knowledge about XML, should decide... :-)
As side effect this new feature also con be used to re-tag
elements.
Up to now to sorts of tagging elements under construction,
lanned, ... are used:
highway=construction construction=primary
or
highway=primary construction=yes
Supporting both results in two larger cascades...
Also now
highway=cycleway
acts as short cut for
highway=path bicylce=designated
This may simplified to
<rule e="way" k="highway" v="construction">
<rule e="way" k="construction" v="*">
<set k="highway" v="{construction}" />
<set k="construction" v="yes" />
</rule>
</rule>
And further on only the cascades of rules for cosntruction=yes is needed.
"Short cuts" may be expanded:
<rule e="way" k="highway" v="cycleway">
<set k="highway" v="path" />
<set k="bicycle" v="designated" />
</rule>
Is this use of "temporary tags" possible in XSLT and perl?
Does anyone can code it for XSLT- and perl-verion, if this
new feature is possible and makes sense and makes sense and if it
doesn't make processing slow or other unwanted side effects?
Heiko "Mueck" Jacobs
More information about the Tilesathome
mailing list