Modify

Opened 5 years ago

Last modified 5 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)

in reply to:  description comment:1 by Klumbumbus, 5 years ago

Replying to francians:

Is there something like this?

No, nothing like this so far.

comment:2 by francians, 5 years ago

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

in reply to:  2 comment:3 by Klumbumbus, 5 years ago

Replying to francians:

if you could give some help.

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

comment:4 by francians, 5 years ago

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 by GerdP, 5 years ago

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

comment:6 by francians, 5 years ago

Will do! Thanks

in reply to:  5 comment:7 by francians, 5 years ago

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. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to francians.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.