OpenRailwayMap / OpenRailwayMap-CartoCSS

CartoCSS port of the OpenRailwayMap styles, originally written in MapCSS
GNU General Public License v3.0
15 stars 20 forks source link

Move signals for each country into their own files #127

Open besentv opened 5 months ago

besentv commented 5 months ago

Like the title says, the goal is to move signalling definitions for each country into their own files for easier navigation, and addition of future signalling systems.

Additionally, I added a license header to each file, like it's suggested by the project's license: https://github.com/OpenRailwayMap/OpenRailwayMap-CartoCSS/blob/master/COPYING#L623

DerDakon commented 5 months ago

This is a good move, but I don't like 2 things. First I would suggest to use short SPDX identifiers instead of copying the license text into each file. And given that you only moved lines around I don't see any reason that you should add your copyright into these files.

besentv commented 5 months ago

First I would suggest to use short SPDX identifiers instead of copying the license text into each file. And given that you only moved lines around I don't see any reason that you should add your copyright into these files.

Sure, I'll be changing it. :)

besentv commented 5 months ago

Done.

besentv commented 4 months ago

Some German and Austrian signals look identical and use the same styling rules. I would like to ask to move these signals to a file called signals_multiple_countries.mss (or a different name if you find a better one).

Did a general rebase and am going to apply this later.

besentv commented 4 months ago

I gave this some thoughts, but I'm not sure if I agree on adding a stylesheet for signals that share the same rules. The idea here is to have no code duplication, which makes perfectly sense, but adding a common file sort of defeats the purpose of splitting the code in the first place. Unfortunately, CartoCSS doesn't have a C or SASS style preprocessor. One proposal I could make is to have a makefile/python script that does that for us, or writing a custom version of the CartoCSS compiler. So we'd end up having something like:

signals_common.mss:

@mixin shunting-stop() {
    marker-file: url('symbols/de/ra10.svg');
    marker-width: 16;
    marker-height: 11;
    marker-allow-overlap: true;
}

signals_at.mss:

[zoom>=17]["feature"="AT-V2:verschubsignal"]["shunting_form"="light"] {
    @include shunting-stop();
}

signals_de.mss:

[zoom>=17]["feature"="DE-ESO:ra10"]["shunting_form"="sign"] {
    @include shunting-stop();
}