at = currentAttributes.get( "highway");
if( ( at != null ) && ( at.equals( "traffic_signals" ) ) ) {
// node = new TrafficLightModel( lat, lon );
node = new NodeModel(lat,lon);
modelManager.addModelElement(new TrafficLightModel(node));
// Do not attempt to do this here because this Trafficlight then has no references to any edge.
// The created nodes (variable n) will be added later at endDocument()!
// modelManager.addModelElement( new TrafficLight( lat, lon ) );
// if you do this, it is added twice
} else if ( ( at != null ) && (at.equals( "bus_stop" ) )) {
node = new RoadSpotModel(lat, lon, RoadSpotModel.Type.Busstop);
modelManager.addModelElement(node);
} else if ( ( at != null ) && (at.equals( "stop" ) )) {
PointOfInterest poi = new PointOfInterest(lat, lon, "stop_sign");
imported = true;
// this means that POIs are added to the model in any case
// and the node is added an other time if it is referenced
// by an edge
modelManager.addModelElement(poi);
node = new NodeModel( lat, lon );
} else if ( ( at != null ) && (at.equals( "crossing" ) )) {
// node = new TrafficLightModel(lat, lon, TrafficLightModel.Crossing);
node = new NodeModel(lat,lon);
modelManager.addModelElement(new TrafficLightModel(node,TrafficLightModel.Type.Crossing));
} else {
at = currentAttributes.get( "name" );
if( at != null ) {
String label = at;
if( currentAttributes.get( "railway" ) != null ) {
label = "Railway Station: " + label;
node = new NodeModel( lat, lon );
} else {
PointOfInterest poi = new PointOfInterest( lat, lon, label );
imported = true;
// this means that POIs are added to the model in any case
// and the node is added an other time if it is referenced
// by an edge
modelManager.addModelElement(poi);
node = new NodeModel( lat, lon );
}
} else {
at = currentAttributes.get( "barrier");
if( ( at != null ) && ( at.equals( "lift_gate" ) ) ) {
// node = new TrafficLightModel(lat,lon, TrafficLightModel.Lift_Gate);
node = new NodeModel(lat,lon);
modelManager.addModelElement(new TrafficLightModel(node,TrafficLightModel.Type.Lift_Gate));
}
else if ( ( at != null ) && (at.equals( "gate" ) )) {
PointOfInterest poi = new PointOfInterest(lat, lon, "gate");
modelManager.addModelElement(poi);
node = new NodeModel(lat,lon);