[josm-dev] How to get selected relations in JOSM?

Paul Hartmann phaaurlt at gmail.com
Mon Jul 7 11:47:32 UTC 2014


On 05.07.2014 16:45, Jochen Willig wrote:
> Dear JOSM-Developers,
>
>
>
> I am developing a Plugin to set automatically a relation with other selected
> relations. Therefore I thought I can use the method getSelectedRelations().
> Unfortunatley it returns nothing. The method getRelations() returns all
> relations in the data set.
>
> Does anyone has an idea why this is not working or a hint how to do it
> differently?

getSelectedRelations() should work. You can get the entire selection and 
check for each entry in the collection if the object is an instance of 
type Relation.

Paul



More information about the josm-dev mailing list