Modify

Opened 3 years ago

Last modified 3 years ago

#18309 new enhancement

mapcss find one or more nodes next to current one

Reported by: francians Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: mapcss validator Cc:

Description

Hello,

I'd like to use mapcss to find all the nodes next to current one...
Example: if there is a natural=tree and I want to search for another one in 20 mt or so.
Is there something like this?
I also think to use this to search for a platform for each stop position with the same name.
What do you think?

Francesco

Attachments (0)

Change History (7)

comment:1 in reply to:  description Changed 3 years ago by Klumbumbus

Replying to francians:

Is there something like this?

No, nothing like this so far.

comment:2 Changed 3 years ago by francians

Ok. Thanks for replying...
I could work on this if there is any kind of interest and if you could give some help.

comment:3 in reply to:  2 Changed 3 years ago by Klumbumbus

Replying to francians:

if you could give some help.

Sorry I personally not, I can't program Java.

comment:4 Changed 3 years ago by francians

I am a Java developer.. but I don't have much experience in JOSM project (just few patches still unrewevied) and so I may need some hint

comment:5 Changed 3 years ago by GerdP

You may start looking at methods NavigatableComponent.getNearestNodes() and DataSet.searchNode()

comment:6 Changed 3 years ago by francians

Will do! Thanks

comment:7 in reply to:  5 Changed 3 years ago by francians

Replying to GerdP:

You may start looking at methods NavigatableComponent.getNearestNodes() and DataSet.searchNode()

I started thinking to the new syntax and I come with:

closest(expr, distance): returns a list of matching nodes

please find some example:

*[public_transport=platform][!contains(key("name"), closest(
    "*[public_transport=stop_position][name]",
    20))]

*[natural=tree][count(closest("*[natural=tree]", 10))>1]

searchNodes() could be fine, do I also need a Finder to evaluate my expression?
Should I cut the BBox for the distance?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to francians
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.