Giter Club home page Giter Club logo

mapcss-parse's People

Contributors

maxgrossman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mapcss-parse's Issues

make regexTypes fully cumulative.

the parser code currently does not use object.assign currectly (my fault!)

it only looks at the 'type level' for merging two objects such that if there are 2 equal types (maybe building=yes, healtcare=clinic)
only the healtcare ends up in the output json.

a small adjustment to make sure we are merging distinct key value pairs (or at the 'tag level') fixes this

allow for numeric values equal types

if a value is numeric for what should be an equals, maybe something like lanes=2, it gets interpretted as a notEqual regex type...
this is because the distinctionRegex for equals does not allow numeric values.

this needs be changed, just by plucking the numeric portion of the regex

parse suggestAlternative

This message gets displayed with the test message
Example:

way[type=palm] {
  throwWarning: tr("{0} is deprecated", "{0.tag}");
  suggestAlternative: "leaf_type";
  suggestAlternative: "trees";
  suggestAlternative: "species";
  group: tr("deprecated tagging");
}

'type=palm' is deprecated, use 'leaf_type' or 'trees' or 'species' instead

support value=*

if config says
"primary":[{"key":"building","val":"*"}]
mapcss selector should be
node[building]

parse fixes

fixAdd: "key=val";
fixRemove: "key";
fixChangeKey: "old=>new";
fixDeleteObject: this; /* deletes the whole object! */

parse * (any geometry)

Example * Geometries:

*[type=palm] {
  throwWarning: tr("{0} is deprecated", "{0.tag}");
  suggestAlternative: "leaf_type";
  suggestAlternative: "trees";
  suggestAlternative: "species";
  group: tr("deprecated tagging");
}

Example Output:

    {
        "geometry": "*",
        "equals": {
            "type": "palm"
        },
        "warning": "'type=palm' is deprecated, use 'leaf_type' or 'trees' or 'species' instead"
    },

parse multiple selectors

Example Multiple Selectors:

node[type=palm],
way[type=palm] {
  throwWarning: tr("{0} is deprecated", "{0.tag}");
  suggestAlternative: "leaf_type";
  suggestAlternative: "trees";
  suggestAlternative: "species";
  group: tr("deprecated tagging");
}

Example Output:

    {
        "geometry": "node",
        "equals": {
            "type": "palm"
        },
        "warning": "'type=palm' is deprecated, use 'leaf_type' or 'trees' or 'species' instead"
    },
    {
        "geometry": "way",
        "equals": {
            "type": "palm"
        },
        "warning": "'type=palm' is deprecated, use 'leaf_type' or 'trees' or 'species' instead"
    },

parse Grouping

Example:

node[oneway],
node[bridge],
node[sidewalk],
node[footway] {
  throwWarning: tr("{0}", "{0.tag}");
  group: tr("tag on a node which should be used on a way");
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.