Ticket #22805: railway___mapcss_parser_error.mapcss

File railway___mapcss_parser_error.mapcss, 2.6 KB (added by mikeho, 3 years ago)
Line 
1/*
2OpenRailwayMap Style File for JOSM
3OpenRailwayMap - Copyright (C) 2023 user: mikeho
4This program comes with ABSOLUTELY NO WARRANTY.
5This is free software, and you are welcome to redistribute it under certain conditions.
6See https://wiki.openstreetmap.org/wiki/OpenRailwayMap for details.
7
8Format details: https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation
9 https://wiki.openstreetmap.org/wiki/MapCSS/0.2
10*/
11
12meta {
13 title: "JOSM - mapcss parser error - 10.03.2023";
14 version: "0.1";
15 description: "a part of Style for railroad network map: Signal - only for error description ";
16 author: "mikeho";
17 watch-modified: true;
18}
19
20
21node|z20-[railway=signal]::layer_521 { z-index: 521; text-offset-x: -80; text-offset-y: -40; font-size: 20; text-color: #FFF020; text-anchor-horizontal: right; text-anchor-vertical: below; text-halo-opacity: 1; text-halo-color: #202020; text-halo-radius: 2; text-allow-overlap: true;
22 /*
23 tmp365: to_double( 1 / 365.25 ); / * error with an comment on end of line * /
24 tmpDy2: to_double(get(split(".", osm_timestamp() / 86400), 0)) * prop("tmp365"); / * error with an comment on end of line * /
25 */
26 /* day per year / phaser error: division didn't work well (comment in row after accours an error !) */
27 tmp365: to_double( 1 / 365.25 );
28 tmpDy2: to_double(get(split(".", osm_timestamp() / 86400), 0)) * prop("tmp365");
29 /* days since 01.01.1970 (comment in row before accours an error !) */
30
31 /* did not work well with division:
32 tmpDy2: to_double(get(split(".", osm_timestamp() / 86400), 0)) / 365.25);
33 */
34
35 tmpDay: concat( 1970 + prop("tmpDy2")); /* year with positions after decimal point "2023.12345" */
36 tYear: get(split(".", prop("tmpDay")), 0); /* year only: - before decimal point - e.g.: "2023" */
37 tmpMo1: get(split(".", prop("tmpDay")), 1); /* only position after decimal point - e.g.: "12345" */
38 tmpMo2: concat("0.", prop("tmpMo1")); /* .. now with "0" and decimal point - e.g.: "0.12345" */
39 tmpMo3: prop("tmpMo2") * 12 + 1; /* tmpMo2 * 12 (Month) + 1 (Month) --> 1, ... ,12 */
40 tMonth: substring( prop("tmpMo3"), 0, 5 ); /* only e.g. "12.34" (5 digits) */
41 text: concat(osm_user_name(), " - ca. Year: ", prop("tYear"), " ca. Month: ", prop("tMonth") );
42}