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

Jochen Willig willigjochen at yahoo.de
Sat Jul 5 14:45:53 UTC 2014


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?

 

Thank you so much!

 

Jochen

 

      for( OsmPrimitive selected : getCurrentDataSet().getRelations()){

                 rel.addMember(new RelationMember(selected.get("type_name"),
selected));

         }  

 

 

for( OsmPrimitive selected : getCurrentDataSet().getSelectedRelations()){

                 rel.addMember(new RelationMember(selected.get("type_name"),
selected));

         }

 

 

 

 



More information about the josm-dev mailing list