Search in sources :

Example 26 with MapShape

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);
}
Also used : MapShape(uk.me.parabola.mkgmap.general.MapShape)

Example 27 with MapShape

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);
}
Also used : MapLine(uk.me.parabola.mkgmap.general.MapLine) MapPoint(uk.me.parabola.mkgmap.general.MapPoint) MapShape(uk.me.parabola.mkgmap.general.MapShape)

Aggregations

MapShape (uk.me.parabola.mkgmap.general.MapShape)27 Coord (uk.me.parabola.imgfmt.app.Coord)15 MapPoint (uk.me.parabola.mkgmap.general.MapPoint)14 ArrayList (java.util.ArrayList)11 MapLine (uk.me.parabola.mkgmap.general.MapLine)10 Point (uk.me.parabola.imgfmt.app.trergn.Point)5 Area (uk.me.parabola.imgfmt.app.Area)4 MapRoad (uk.me.parabola.mkgmap.general.MapRoad)4 MapExitPoint (uk.me.parabola.mkgmap.general.MapExitPoint)3 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)2 Long2ObjectOpenHashMap (it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap)2 List (java.util.List)2 FilterConfig (uk.me.parabola.mkgmap.filters.FilterConfig)2 IdentityHashMap (java.util.IdentityHashMap)1 GeneralRouteRestriction (uk.me.parabola.imgfmt.app.net.GeneralRouteRestriction)1 Polygon (uk.me.parabola.imgfmt.app.trergn.Polygon)1 Subdivision (uk.me.parabola.imgfmt.app.trergn.Subdivision)1 Zoom (uk.me.parabola.imgfmt.app.trergn.Zoom)1 DouglasPeuckerFilter (uk.me.parabola.mkgmap.filters.DouglasPeuckerFilter)1 LinePreparerFilter (uk.me.parabola.mkgmap.filters.LinePreparerFilter)1