Opened 8 years ago

Last modified 8 years ago

#12282 closed enhancement

Remove XML mappaint support — at Version 50

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 16.04
Component: Core mappaint Version:
Keywords: xml mapcss Cc: bastiK, Klumbumbus, simon04, yopaseopor, lists@…

Description (last modified by stoecker)

We have today 81 styles listed on styles.

Only 7 of them are still in XML format. I propose to rewrite them in MapCSS and drop support for old XML styles:

  1. https://github.com/avar/osmis-josm-style/blob/master/elemstyles_is.xml ==> to rewrite
  2. http://www.freietonne.de/ft_icons/josm/FreieTonne_rules_presets_zip.php ==> Converted
  3. Styles/FrenchEPCI ==> Converted
  4. Styles/LegacyStandard ==> to remove from list
  5. Styles/Lit ==> Converted
  6. Styles/MaxspeedIcons ==> to drop (integrated in core)
  7. Styles/Traffic_signs ==> Converted

I don't remember how we switched from XML to MapCSS: is there a transformation script somewhere? All styles are quite small except traffic signs...

Change History (50)

comment:1 by stoecker, 8 years ago

For FreieTonne: I wonder that Jan should not react. Are you sure he got the mail? Dropping that style without informing him is not ok I think. Did you also try the email from here: http://www.jesse.de/HTML/impressum.shtml ?

comment:2 by stoecker, 8 years ago

I'll try to send him an mail.

comment:3 by yopaseopor, 8 years ago

Well, I understand JOSM has to be improved...but removing capabilities? You say ok, rewrite it. It is not easy for me (I will have to investigate if it is possible to me) . I don't know anything about programming or codes, I have only learned to open something and If I understand how it works I can change it and improve it. I did the style traffic signs tweaking Speedlimit Signs code from Martin Koppenhoefer. The style is good, it works...Now you tell me I have to change it, "translate the code" ...but How? Can you help me? Can you give me some examples to understand how MapCSS works? Can you make some lines of code of my style to rewrite the whole style? How I have to change the code? Anybody can help me? I have dedicated a lot of hours to make it possible. Can you help me?

Last edited 8 years ago by yopaseopor (previous) (diff)

in reply to:  description ; comment:4 by bastiK, 8 years ago

Replying to Don-vip:

I propose to rewrite them in MapCSS and drop support for old XML styles

I'm not as eager to get rid of the xml format, but I see no reason to keep it, either.

I don't remember how we switched from XML to MapCSS: is there a transformation script somewhere?

Wasn't very sophisticated, I don't think I have saved anything.

in reply to:  4 comment:5 by yopaseopor, 8 years ago

Replying to bastiK:

Replying to Don-vip:

I propose to rewrite them in MapCSS and drop support for old XML styles

I'm not as eager to get rid of the xml format, but I see no reason to keep it, either.

I see one powerful reason: I don't know how to change my style so my style won't work without XML support :(

in reply to:  2 ; comment:6 by stoecker, 8 years ago

Replying to stoecker:

I'll try to send him an mail.

Vincent: Jan answered immediately. Also for the preset I don't understand the error - The URL which is told as error is not in the presets file. Did you maybe mix something here?

in reply to:  3 ; comment:7 by bastiK, 8 years ago

Replying to yopaseopor:

Well, I understand JOSM has to be improved...but removing capabilities? You say ok, rewrite it. It is not easy for me (I will have to investigate if it is possible to me) . I don't know anything about programming or codes, I have only learned to open something and If I understand how it works I can change it and improve it. I did the style traffic signs tweaking Speedlimit Signs code from Martin Koppenhoefer. The style is good, it works...Now you tell me I have to change it, "translate the code" ...but How? Can you help me? Can you give me some examples to understand how MapCSS works? Can you make some lines of code of my style to rewrite the whole style? How I have to change the code? Anybody can help me? I have dedicated a lot of hours to make it possible. Can you help me?

Please don't panic! :)

You don't have to be a programmer, to understand MapCSS. Especially for your Traffic sign style it shouldn't be too hard: Have a look at the first example in the tutorial (And maybe some other available styles). If you cannot get it to work, we will help!

Sorry for the inconvenience, but sometimes this happens in the open source world...

in reply to:  7 ; comment:8 by yopaseopor, 8 years ago

Replying to bastiK:

Please don't panic! :)

You don't have to be a programmer, to understand MapCSS. Especially for your Traffic sign style it shouldn't be too hard: Have a look at the first example in the tutorial (And maybe some other available styles). If you cannot get it to work, we will help!

I panic because first thing I have done before write these lines is open some MapCSS style and I did not understand anything. Also I have opened https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSTutorial and https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation and I don't understand how it works . I am so worried. Please help me.

Last edited 8 years ago by yopaseopor (previous) (diff)

in reply to:  6 ; comment:9 by Don-vip, 8 years ago

Description: modified (diff)

Replying to stoecker:

Replying to stoecker:

I'll try to send him an mail.

Vincent: Jan answered immediately.

I don't know who Jan is. I sent an e-mail on 24/10/2015 to fta at freietonne.de (which is the only contact listed on https://www.freietonne.de home page) and nobody answered. I also sent an e-mail about this (same day) on josm-dev and nobody replied neither.

Also for the preset I don't understand the error - The URL which is told as error is not in the presets file. Did you maybe mix something here?

You're right. The presets have been modified on 2015-10-27, 3 days after my e-mail, but I wasn't notified. I'm going to restore it, that's good news :)

in reply to:  8 ; comment:10 by Don-vip, 8 years ago

Replying to yopaseopor:

I am so worried. Please help me.

Don't worry, we're going to help you :) Don't want to loose any active contributor with this change, and you do great work! It seems complicated at first glance but you don't need to understand all features. The basic features are quite simple and the resulting file is easier to update once you know the syntax. Also, it's far more powerful, maybe you will have new ideas for the style after :)

in reply to:  10 comment:11 by yopaseopor, 8 years ago

Replying to Don-vip:

Replying to yopaseopor:

I am so worried. Please help me.

Don't worry, we're going to help you :) Don't want to loose any active contributor with this change, and you do great work! It seems complicated at first glance but you don't need to understand all features. The basic features are quite simple and the resulting file is easier to update once you know the syntax. Also, it's far more powerful, maybe you will have new ideas for the style after :)

One Catalan Community member is helping me in this moment.I hope I can translate it in a few time. For things he explains me it is true it seems more powerful and I start thinking new ideas for some items...Thank your for your attention.

comment:12 by Don-vip, 8 years ago

Description: modified (diff)

First conversion example: FrenchEPCI

comment:13 by Don-vip, 8 years ago

I have some problems to get identical rendering with Styles/Lit for this rule:

  <rule>
    <condition k="lit" b="no"/>
    <linemod mode="over" width="10" realwidth="8" colour="lit_no#000000B0"/>
  </rule>

I came up with the following:

meta {
    title: "Lit";
    version: "2.0";
    description: "Show lit=yes/no settings in JOSM map display";
    author: "cmuelle8";
    link: "https://josm.openstreetmap.de/wiki/Styles/Lit";
}
way[lit=yes]::lit_layer
{
    object-z-index: +1.0;
    width: +10;
    opacity: 0.75;
    color: #EEEECC;
}
way[lit=no]::lit_layer
{
    object-z-index: +1.0;
    width: +10;
    opacity: 0.75;
    color: #000000;
}

Original XML style darkens the ways with lit=no, I can't get the same result with MapCSS, any hint?

in reply to:  9 comment:14 by stoecker, 8 years ago

Vincent: Jan answered immediately.

I don't know who Jan is. I sent an e-mail on 24/10/2015 to fta at freietonne.de (which is the only contact listed on https://www.freietonne.de home page) and nobody answered. I also sent an e-mail about this (same day) on josm-dev and nobody replied neither.

Jan Jesse - the operator of Freie Tonne. Seems he has a major mail misconfiguration, as sending mail to that address does not work :-)

Also for the preset I don't understand the error - The URL which is told as error is not in the presets file. Did you maybe mix something here?

You're right. The presets have been modified on 2015-10-27, 3 days after my e-mail, but I wasn't notified. I'm going to restore it, that's good news :)

That line-dance URL very likely never was part of the preset. I assume an mixup in the checkscript. Anyway I told him about some double entries in the preset which should be fixed. He'll also have a look at MapCSS.

comment:15 by yopaseopor, 8 years ago

Help me please, I did the conversion work, but there is some error that makes wrong all the style. Check it please .
https://josm.openstreetmap.de/wiki/Styles/Traffic_signs

comment:16 by Don-vip, 8 years ago

Description: modified (diff)

comment:17 by Don-vip, 8 years ago

you can't have spaces between conditions, I have removed them.

in reply to:  13 comment:18 by Don-vip, 8 years ago

Replying to Don-vip:

I can't get the same result with MapCSS, any hint?

Found it, +1.0 is not valid, must be 1.0

comment:19 by Don-vip, 8 years ago

Description: modified (diff)

Is there a way to archive old styles (Legacy and MaxspeedIcons), so we keep them on the wiki but they are not included in the list?

in reply to:  19 comment:20 by stoecker, 8 years ago

Replying to Don-vip:

Is there a way to archive old styles (Legacy and MaxspeedIcons), so we keep them on the wiki but they are not included in the list?

I can change the scripts, so XML is marked as deprecated in the wiki list and not included in JOSM download list.

comment:21 by stoecker, 8 years ago

XML styles are now marked with bold "XML" in version field and have "style-type"="xml" in the download file. Future JOSM versions can skip entries with this marker easily when no longer supported.

comment:22 by Klumbumbus, 8 years ago

#10540 should be fixed before XML support is dropped. It seems bastiK is working on it (#9891).

comment:23 by yopaseopor, 8 years ago

One question, I add some missign icons in the zip file but now it gets me timeout error. How I can fix it? Is it correct?

in reply to:  23 ; comment:24 by stoecker, 8 years ago

Replying to yopaseopor:

One question, I add some missign icons in the zip file but now it gets me timeout error. How I can fix it? Is it correct?

Hmm, you replaced the file during my debugging. It works now. Do you know what was special about the previous zip?

comment:25 by stoecker, 8 years ago

@yopaseopor: One comment - I'd suggest to use SVG wherever possible or there will be the next issue with the upcoming HIDPI display changes :-)

in reply to:  24 ; comment:26 by yopaseopor, 8 years ago

Replying to stoecker:

Replying to yopaseopor:

One question, I add some missign icons in the zip file but now it gets me timeout error. How I can fix it? Is it correct?

Hmm, you replaced the file during my debugging. It works now. Do you know what was special about the previous zip?

Sorry, it was a complete file with all the icons, then I drop the icons and let the zip empty. Now I have reuploaded full (1.4MB) Can you try again?

in reply to:  26 ; comment:27 by stoecker, 8 years ago

Replying to yopaseopor:

Replying to stoecker:

Replying to yopaseopor:

One question, I add some missign icons in the zip file but now it gets me timeout error. How I can fix it? Is it correct?

Hmm, you replaced the file during my debugging. It works now. Do you know what was special about the previous zip?

Sorry, it was a complete file with all the icons, then I drop the icons and let the zip empty. Now I have reuploaded full (1.4MB) Can you try again?

Ok. The file simply has too many entries. Please reupload the previous smaller file (and remove the mapcss file which is inside). I copied the file and will check if I can speedup the server code. I removed the icons file causing the trouble.

in reply to:  22 comment:28 by Don-vip, 8 years ago

Replying to Klumbumbus:

#10540 should be fixed before XML support is dropped. It seems bastiK is working on it (#9891).

Sure. I have added those two tickets to current milestone, I wait before assigning this one.

in reply to:  27 ; comment:29 by yopaseopor, 8 years ago

Replying to stoecker:

Ok. The file simply has too many entries. Please reupload the previous smaller file (and remove the mapcss file which is inside). I copied the file and will check if I can speedup the server code. I removed the icons file causing the trouble.

I think I have done now correctly. Also I start to make local test with wikipedia's URLs and files to get the traffic signs in SVG. Stay tuned ;)

in reply to:  29 comment:30 by stoecker, 8 years ago

Replying to yopaseopor:

Replying to stoecker:

Ok. The file simply has too many entries. Please reupload the previous smaller file (and remove the mapcss file which is inside). I copied the file and will check if I can speedup the server code. I removed the icons file causing the trouble.

I think I have done now correctly. Also I start to make local test with wikipedia's URLs and files to get the traffic signs in SVG. Stay tuned ;)

I did a small speed improvement. Instead of 294 seconds it now takes 200 milliseconds :-) The code was a little suboptimal. I changed your upload comment from "(NOZIP)" to "(EXTRACT)" again and the icons are included as they should be.

comment:31 by Klumbumbus, 8 years ago

Maybe some users use their own small styles, which are saved only local and not linked in this wiki. Should we display a message on the startup page like:

JOSM will soon no longer support mappaint styles written in the old XML format. [e.g._link to_this_ticket More info]

?

comment:32 by stoecker, 8 years ago

Wouldn't a program text "You use an XML style. This will no longer be supported in future versions" be better, as it can test for such a style first?

comment:33 by Klumbumbus, 8 years ago

Yes that would be better :)

Maybe similar to the layer box, which appears now when you add bing imagery?

comment:34 by Don-vip, 8 years ago

Good idea I'll look into it.

comment:35 by stoecker, 8 years ago

In 16.02 I'd suggest. So the converted styles have been activated until then.

comment:36 by Klumbumbus, 8 years ago

As we currently replace a lot icons would it be good to have a jenkins test also for styles, similar to the one we already have for presets?

in reply to:  36 ; comment:37 by stoecker, 8 years ago

Replying to Klumbumbus:

As we currently replace a lot icons would it be good to have a jenkins test also for styles, similar to the one we already have for presets?

Uuuh. Maybe that can wait two weeks? The current server is already a bit overloaded and renewal is anyway soon and I want to ask for one of the more powerful servers they have now.

in reply to:  37 comment:38 by Don-vip, 8 years ago

Replying to stoecker:

Replying to Klumbumbus:

As we currently replace a lot icons would it be good to have a jenkins test also for styles, similar to the one we already have for presets?

Uuuh. Maybe that can wait two weeks? The current server is already a bit overloaded and renewal is anyway soon and I want to ask for one of the more powerful servers they have now.

The test already exists. But it does only detect syntax errors, not missing icons. Checking also missing icons shouldn't affect server performance at all.

comment:39 by Don-vip, 8 years ago

It's good news to have a more powerful server. What hardware are you going to ask for?

in reply to:  39 comment:40 by stoecker, 8 years ago

Replying to Don-vip:

It's good news to have a more powerful server. What hardware are you going to ask for?

See private mail. I don't want to publish anything before I actually talked to our sponsors.

comment:41 by Don-vip, 8 years ago

In 9334/josm:

see #12282 - handle warnings for mappaint styles:

  • Log warnings that occur when loading style
  • Display them in Mappaint dialog (Info action)
  • Drop redundant error icon
  • Ignore XML styles in styles validation test
  • Make styles validation test fail if at least a warning occur

comment:42 by Don-vip, 8 years ago

The updated test does not yet detect missing icons, but it detects other kinds of warnings:

INFO: GET https://raw.githubusercontent.com/molysgaard/OAM-JOSM/master/oam-style.mapcss -> 200 (472 B)
WARNING: Detected deprecated 'canvas{background-color}' in 'https://raw.github.com/molysgaard/OAM-JOSM/master/oam-style.mapcss' which will be removed shortly. Use 'fill-color' instead.
 => KO
INFO: GET https://codeload.github.com/GlassOceanos/indoor-JOSM-style/zip/master -> 200 (10.5 kB)
WARNING: Detected deprecated 'canvas{background-color}' in 'https://github.com/GlassOceanos/indoor-JOSM-style/archive/master.zip' which will be removed shortly. Use 'fill-color' instead.
 => KO

I have created PRs:
https://github.com/molysgaard/OAM-JOSM/pull/2
https://github.com/GlassOceanos/indoor-JOSM-style/pull/2

@bastiK: is it OK to remove support for canvas{background-color} once these PRs have been merged? It is deprecated for a long time (r7110).

comment:43 by Don-vip, 8 years ago

In 9336/josm:

see #12282 - log a warning for MapCSS @media queries (deprecated since @supports has been introduced in r8087)

comment:44 by Don-vip, 8 years ago

two more:

INFO: GET http://www.openrailwaymap.org/styles/signals.zip -> 200 (78.2 kB)
ERROR: Detected deprecated '@media' in 'OpenRailwayMap signalling layer' which will be removed shortly. Use '@supports' instead.
WARNING: Initializing map style http://www.openrailwaymap.org/styles/signals.zip completed in 30 ms (0 errors, 1 warnings)
 => KO
INFO: GET https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1 -> 200 (7.88 kB)
ERROR: Detected deprecated '@media' in 'Coloured Streets' which will be removed shortly. Use '@supports' instead.
WARNING: Initializing map style https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1 completed in 48 ms (0 errors, 1 warnings)
 => KO

comment:45 by Don-vip, 8 years ago

Coloured Street contains:

/* Display a warning message if the josm version is too old, can be hidden by a style setting */
@media (max-josm-version: 7479)
{
node[setting("display_old_josm")][fixme]::core_fixme,
node[setting("display_old_josm")][note]::core_note,
node[setting("display_old_josm")][place]::oldJOSM,
node[setting("display_old_josm")][natural]::oldJOSM,
node[setting("display_old_josm")]:new::oldJOSM
{
        text: tr("Your JOSM version is too old for the mappaint style Coloured Streets. Please update JOSM.");
        text-color: orange;
        text-halo-radius: 2;
        text-halo-color: black;
        font-size: 11;
        major-z-index: 100;
}
}

We could replace the @media query by @support rules, but it would not make any sense, as supports rule have been introduced after r7479 (in r8087).
Versions between r6970 (introduction of @media) and r7479 are in very low usage:

Recent versions (>= 7001):
Java Main Version --> 6 (8,  0.1%) 7 (1485, 21.6%) 8 (5380, 78.2%) 9 (3,  0.0%)
OS:  FreeBSD (7,  0.1%) Linux (1810, 26.3%) Mac (486,  7.1%) OpenBSD (4,  0.1%) Windows (4570, 66.5%)

OLD versions support @media (6970 <= 7479):
Java Main Version --> 7 (21, 40.4%) 8 (31, 59.6%)
OS:  Linux (8, 15.4%) Mac (1,  1.9%) Windows (43, 82.7%)

So the simplest is to drop this block.

comment:47 by Don-vip, 8 years ago

Last PR created: https://github.com/avar/osmis-josm-style/pull/3

Waiting for Freietonne now.

comment:48 by Aun Johnsen <lists@…>, 8 years ago

Cc: lists@… added

in reply to:  42 comment:49 by bastiK, 8 years ago

Replying to Don-vip:

@bastiK: is it OK to remove support for canvas{background-color} once these PRs have been merged? It is deprecated for a long time (r7110).

Yes, should be okay.

comment:50 by stoecker, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.