Merge pull request #249 from shramov/operator-name
MapObject: set name from operator
This commit is contained in:
commit
5b3424c69e
1 changed files with 11 additions and 0 deletions
|
@ -43,6 +43,17 @@ public abstract class MapObject implements Comparable<MapObject>, Serializable {
|
||||||
if(this.location == null){
|
if(this.location == null){
|
||||||
this.location = MapUtils.getCenter(e);
|
this.location = MapUtils.getCenter(e);
|
||||||
}
|
}
|
||||||
|
this.setNameFromOperator(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNameFromOperator(Entity e){
|
||||||
|
if (this.name != null) return;
|
||||||
|
String op = e.getTag(OSMTagKey.OPERATOR);
|
||||||
|
String ref = e.getTag(OSMTagKey.REF);
|
||||||
|
if (op == null) return;
|
||||||
|
if (ref != null)
|
||||||
|
op += " [" + ref + "]";
|
||||||
|
this.name = op;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityId getEntityId(){
|
public EntityId getEntityId(){
|
||||||
|
|
Loading…
Reference in a new issue