Changeset 32398 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/PublicTransportHelper.java
- Timestamp:
- 2016-06-25T11:56:57+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/PublicTransportHelper.java
r32395 r32398 7 7 8 8 /** 9 * @author freeExec 9 10 * @see http://wiki.openstreetmap.org/wiki/Key:public_transport 10 */11 12 /**13 *14 * @author freeExec15 11 */ 16 12 public final class PublicTransportHelper { 17 13 18 public final staticString PUBLIC_TRANSPORT = "public_transport";19 public final staticString STOP_POSITION = "stop_position";20 public final staticString STOP = "stop";21 public final staticString STOP_AREA = "stop_area";22 public final staticString PLATFORM = "platform";23 public final staticString HIGHWAY = "highway";24 public final staticString RAILWAY = "railway";25 public final staticString BUS_STOP = "bus_stop";26 public final staticString RAILWAY_HALT = "halt";27 public final staticString RAILWAY_STATION = "station";14 public static final String PUBLIC_TRANSPORT = "public_transport"; 15 public static final String STOP_POSITION = "stop_position"; 16 public static final String STOP = "stop"; 17 public static final String STOP_AREA = "stop_area"; 18 public static final String PLATFORM = "platform"; 19 public static final String HIGHWAY = "highway"; 20 public static final String RAILWAY = "railway"; 21 public static final String BUS_STOP = "bus_stop"; 22 public static final String RAILWAY_HALT = "halt"; 23 public static final String RAILWAY_STATION = "station"; 28 24 29 25 private PublicTransportHelper() { … … 54 50 String pt = p.get(PUBLIC_TRANSPORT); 55 51 if (STOP_POSITION.equals(pt)) return true; 56 } 57 else if (p.hasKey(RAILWAY)) { 52 } else if (p.hasKey(RAILWAY)) { 58 53 String rw = p.get(RAILWAY); 59 54 if (RAILWAY_HALT.equals(rw) || RAILWAY_STATION.equals(rw)) return true; … … 83 78 return false; 84 79 } 80 85 81 public static boolean isWayPlatform(RelationMember m) { 86 82 return isWayPlatform(m.getMember()); … … 121 117 if (result != null) return result; 122 118 // try to get name by stop_area 123 for (OsmPrimitive refOp : prim.getReferrers()) 119 for (OsmPrimitive refOp : prim.getReferrers()) { 124 120 if (refOp.getType() == OsmPrimitiveType.RELATION 125 && refOp.hasTag(PUBLIC_TRANSPORT, STOP_AREA)) { 121 && refOp.hasTag(PUBLIC_TRANSPORT, STOP_AREA)) { 126 122 result = refOp.getName(); 127 123 if (result != null) return result; 128 124 } 125 } 129 126 return result; 130 127 }
Note:
See TracChangeset
for help on using the changeset viewer.