Giter Site home page Giter Site logo

Comments (2)

bryceco avatar bryceco commented on July 16, 2024 1

Great question! In general everything is combined with AND, but with an important exception (which I'll get to).

In the first case you have:

amenity=bicycle_rental
bicycle_rental=docking_station
capacity=

and these will all be combined with AND, so all three need to match.

In the second case you have:

amenity=bicycle_parking
capacity:cargo_bike=
cargo_bike=

and again these are all combined with AND, which is probably not what you want. To get the OR result you want you'll have to write two different quests. (However, looking at this I realize that the code could probably be made smart enough to notice that the tagKeys array lists both the items you're filtering on, which means that you want to set both of those keys and they should probably use an OR. Let me work on that!)

Moving on, what is the exception? There are situations where using AND doesn't make any sense and we can conclude that OR is necessary. If you have a key duplicated using an = relation with different values then using AND will never be true, so we infer that it is an OR:

amenity=cafe
amenity=restaurant
website=

In this situation the amenity values would be ORs, and the result of that would be AND everything else.

Except there's exception to this exception! We only convert multiple values to OR when the relation is =. If the relation is ≠ then it's non-sensical to use OR (because it would always be true):

amenity≠cafe
amenity≠restaurant
website=

In this case the amenity values would use AND.

Hope that helps!

from gomap.

bickelmeister avatar bickelmeister commented on July 16, 2024

It helps a lot. I see two approaches. You can make the code a bit smarter, or let the user decide :)

At least for the expanded quest build. But I am sure you will find a good solution :)
Thanks for clarification.

from gomap.

Related Issues (20)

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.