[josm-dev] Selecting a line nearest a point

Josh Doe josh at joshdoe.com
Mon May 28 04:31:05 BST 2012


I have a plugin (conflation) with a custom layer which draws arrows
between matched pairs of objects, and I'd like to enable these to be
clicked to select the match so it can be merged or deleted. I'm not
familiar with JOSM's map display code, so I'm not sure where to look.
I need to find the line closest to a point, or more simply the first
line which is within N-pixels of the clicked point. It would be nice
if it could be performant as well, by only checking lines which are
shown on the screen (spatial index?).

Thanks,
-Josh



More information about the josm-dev mailing list