Ticket #17845: 17845.patch
| File 17845.patch, 1.7 KB (added by , 7 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
28 28 import org.openstreetmap.josm.data.osm.IPrimitive; 29 29 import org.openstreetmap.josm.data.osm.Node; 30 30 import org.openstreetmap.josm.data.osm.OsmPrimitive; 31 import org.openstreetmap.josm.data.osm.Relation; 32 import org.openstreetmap.josm.data.osm.RelationMember; 31 33 import org.openstreetmap.josm.data.osm.Way; 32 34 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 33 35 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match; … … 570 572 } 571 573 572 574 /** 575 * Returns true if role is in relation. Returns false if not a relation or it does not have the role. 576 * @param env the environment 577 * @param role The role that the relation should have 578 * @return true if the role is in the relation 579 * @since xxx 580 */ 581 public static boolean has_role(final Environment env, String role) { // NO_UCD (unused code) 582 if (env.osm instanceof Relation) { 583 Relation rel = (Relation) env.osm; 584 for (RelationMember member : rel.getMembers()) { 585 if (role.equals(member.getRole())) return true; 586 } 587 } 588 return false; 589 } 590 591 /** 573 592 * Returns the area of a closed way or multipolygon in square meters or {@code null}. 574 593 * @param env the environment 575 594 * @return the area of a closed way or multipolygon in square meters or {@code null}
