1

I am looking to check if all nodes of a way are near a gpx track. Therefore, I have valid nodes which is the result of an around query on .item_nodes with the gpx track. And my .item_nodes which are the nodes of a way i am checking.

I want to check that more than 60% of the way's nodes are near the gpx track. Therefore I used a .r set with two tags : valid and item and I want to compare them but it does not work.

The only thing that works is setting a difference of set between .valid_nodes and .item_nodes and checking that the difference is 0 but then I cannot compare with a pourcentage of the size of the set...

Here is my code

.valid_nodes -> ._;
out count;
make count valid = count(nodes)-> .p; //debug
.item_nodes -> ._;
make count item = count(nodes)-> .q; //debug

(.p; .q;)->.r;
.r out;
                 
//(.item_nodes; - .valid_nodes;) -> ._;
(
  .r;
  if (t["valid"] > 0.6*t["item"])
   (
     (.matching_items_bridges; .item;) -> .matching_items_bridges;
   )
  )
)

And here is the current working code:

(.item_nodes; - .valid_nodes;) -> ._;

  if (count(nodes) == 0)
   (
     (.matching_items_bridges; .item;) -> .matching_items_bridges;
   )
1
  • Hi @JulesL, welcome to GIS SE! Could you please share the full query, so that users who want to help you are able to run it? It seems there's at least the first part missing. Commented Dec 14, 2024 at 17:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.