use of uk.me.parabola.mkgmap.general.MapShape in project mkgmap by openstreetmap.
the class MapperBasedMapDataSource method addBackground.
/**
* We add the background polygons if the map is not transparent.
*/
public void addBackground() {
MapShape background = new MapShape();
background.setPoints(mapper.getBounds().toCoords());
// background type
background.setType(0x4b);
// On all levels
background.setMinResolution(0);
mapper.addShape(background);
}
use of uk.me.parabola.mkgmap.general.MapShape in project mkgmap by openstreetmap.
the class PolishMapDataSource method sectionStart.
/**
* Record that we are starting a new section.
* Section names are enclosed in square brackets. Inside the section there
* are a number of lines with the key=value format.
*
* @param line The raw line from the input file.
*/
private void sectionStart(String line) {
String name = line.substring(1, line.length() - 1).trim();
log.debug("section name", name);
extraAttributes = null;
if (name.equalsIgnoreCase("IMG ID")) {
section = S_IMG_ID;
} else if (name.equalsIgnoreCase("POI") || name.equals("RGN10") || name.equals("RGN20")) {
point = new MapPoint();
section = S_POINT;
} else if (name.equalsIgnoreCase("POLYLINE") || name.equals("RGN40")) {
polyline = new MapLine();
roadHelper.clear();
section = S_POLYLINE;
} else if (name.equalsIgnoreCase("POLYGON") || name.equals("RGN80")) {
shape = new MapShape();
section = S_POLYGON;
} else if (name.equalsIgnoreCase("Restrict")) {
restriction = new PolishTurnRestriction();
section = S_RESTRICTION;
} else
System.out.println("Ignoring unrecognised section: " + name);
}
Aggregations