use of uk.me.parabola.imgfmt.app.lbl.ExitFacility in project mkgmap by openstreetmap.
the class MapBuilder method processExit.
private void processExit(Map map, MapExitPoint mep) {
LBLFile lbl = map.getLblFile();
String ref = mep.getMotorwayRef();
String OSMId = mep.getOSMId();
if (ref != null) {
Highway hw = highways.get(ref);
if (hw == null)
hw = makeHighway(map, ref);
if (hw == null) {
log.warn("Can't create exit", mep.getName(), "(OSM id", OSMId, ") on unknown highway", ref);
return;
}
String exitName = mep.getName();
String exitTo = mep.getTo();
Exit exit = new Exit(hw);
String facilityDescription = mep.getFacilityDescription();
log.info("Creating", ref, "exit", exitName, "(OSM id", OSMId + ") to", exitTo, "with facility", ((facilityDescription == null) ? "(none)" : facilityDescription));
if (facilityDescription != null) {
// description is TYPE,DIR,FACILITIES,LABEL
// (same as Polish Format)
String[] atts = facilityDescription.split(",");
int type = 0;
if (atts.length > 0)
type = Integer.decode(atts[0]);
char direction = ' ';
if (atts.length > 1) {
direction = atts[1].charAt(0);
if (direction == '\'' && atts[1].length() > 1)
direction = atts[1].charAt(1);
}
int facilities = 0x0;
if (atts.length > 2)
facilities = Integer.decode(atts[2]);
String description = "";
if (atts.length > 3)
description = atts[3];
// FIXME - handle multiple facilities?
boolean last = true;
ExitFacility ef = lbl.createExitFacility(type, direction, facilities, description, last);
exit.addFacility(ef);
}
mep.setExit(exit);
POIRecord r = lbl.createExitPOI(exitName, exit);
if (exitTo != null) {
Label ed = lbl.newLabel(exitTo);
exit.setDescription(ed);
}
poimap.put(mep, r);
// FIXME - set bottom bits of
// type to reflect facilities available?
}
}
Aggregations