[josm-dev] Selecting a line nearest a point

Greg Troxel gdt at ir.bbn.com
Mon May 28 14:19:33 BST 2012


Josh Doe <josh at joshdoe.com> writes:

> 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?).

I haven't had enough spare time to get to this, but I've wondered about
having josm store the local data in postgis instead of a file that is
read/loaded.   That would enable having more data (josm does much better
than it used to, it seems), and also provide spatial queries.



More information about the josm-dev mailing list