Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #58499
    Avatar photoEmux
    Participant

    This works the same way in both Mapsforge and VTM.

    Can render theme creators check this discussion and see if Mapsforge needs changes?

    Have you seen any problems with the negative rule?

    The code for “matchesTags” in negative rule:
    Mapsforge negative rule
    VTM negative rule


    Cruiser and Mapsforge developer

    #58500
    Avatar photoEmux
    Participant

    An example of negative rule is “~|no|false”.


    Cruiser and Mapsforge developer

    1 user thanked author for this post.
    #58501
    Avatar photoJohnPercy
    Participant

    AFAIK in Mapsforge,
    1. The “~” rule works as intended and as documented
    2. The “false” rule will match on any key having the value of “false” which is the case with any other Mapsforge test.
    This is an annoyance rather than a useful feature.

    Voluntary and Velocity themes - https://voluntary.nichesite.org

    1 user thanked author for this post.
    #58502
    Avatar photoJohnPercy
    Participant

    OAM maps transform area=no to area=area_no for just this reason (re example given in GitHub discussion)

    Voluntary and Velocity themes - https://voluntary.nichesite.org

    1 user thanked author for this post.
    #58503
    Avatar photoTobias
    Keymaster

    Thanks John! Yes, usually we call it the “common value bug”, and since we’ve been using the workaround (example above) it’s no real issue anymore. Emux, you even talk about it here:
    https://www.openandromaps.org/oam-forums/topic/mapsforge-0-5-0#post-3532

    Developer of Elevate mapstyle

    • This reply was modified 5 months, 1 week ago by Avatar photoTobias.
    #58505
    Avatar photoEmux
    Participant

    I mean do we need changes in Mapsforge code to improve this situation?

    – Now it seems that the rule matches when the key is not present or any key has the value “false”.

    – While it should match when the key is not present or the specified key has the value “false”?


    Cruiser and Mapsforge developer

    #58506
    Avatar photoJohnPercy
    Participant

    To be clear, it is exactly the same for *any* key-value pair.
    For example, a test on foot=”yes” will match if *any* key for that map item has the value “yes”. The value is not tied to its key but to the map item and thus to *all* keys for that map item.
    It is clearly a bug, but one that OAM has worked around satisfactorily. If you correct the bug, it needs to be corrected for all key-value pairs and then map themes will have to be changed extensively.

    Voluntary and Velocity themes - https://voluntary.nichesite.org

    #58507
    Avatar photoEmux
    Participant

    The report was about the negative rule and checking its code could lead to an improvement.

    The positive rule already checks the specified key.

    Map library is open source, if anyone can also find any improvements in the positive rule code, I can check it.

    Mapsforge positive rule code


    Cruiser and Mapsforge developer

    #58508
    Avatar photoJohnPercy
    Participant

    Sorry, I forgot that particular (positive) issue had been dealt with.
    As I understand it, the issue now in question is for a test including ~ and other values. A test without ~, for example foot=no, is covered by the positive rule code.
    If so, I think the Mapsforge negative code should be amended and I don’t think it would affect my themes.

    Voluntary and Velocity themes - https://voluntary.nichesite.org

    1 user thanked author for this post.
    #58511
    Avatar photoTobias
    Keymaster

    – While it should match when the key is not present or the specified key has the value „false“?

    That should be the expected behavior. Any key can be matched with k=”*“ and v=”false”, so in my logic k=”k” and v=”false” should only match k=false.
    Fixing this in mapsforge shouldn’t break current themes and the OAM workaround, but is a good idea anyway.

    Developer of Elevate mapstyle

    3 users thanked author for this post.
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.