Search in sources :

Example 6 with Zoom

use of uk.me.parabola.imgfmt.app.trergn.Zoom in project mkgmap by openstreetmap.

the class OverviewBuilder method readLines.

/**
 * Read the lines from the .img file and add them to the overview map.
 * We read from the least detailed level (apart from the empty one).
 *
 * @param mapReader Map reader on the detailed .img file.
 */
private void readLines(MapReader mapReader) {
    Zoom[] levels = mapReader.getLevels();
    for (int l = 1; l < levels.length; l++) {
        int min = levels[l].getLevel();
        int res = levels[l].getResolution();
        List<Polyline> lineList = mapReader.linesForLevel(min);
        // System.out.println(lineList.size() + " lines in lowest resolution " + levels[1].getResolution());
        for (Polyline line : lineList) {
            if (log.isDebugEnabled())
                log.debug("got line", line);
            MapLine ml = new MapLine();
            List<Coord> points = line.getPoints();
            if (log.isDebugEnabled())
                log.debug("line point list", points);
            if (points.size() < 2)
                continue;
            ml.setType(line.getType());
            if (line.getLabel() != null)
                ml.setName(line.getLabel().getText());
            ml.setMaxResolution(res);
            ml.setMinResolution(res);
            ml.setPoints(points);
            overviewSource.addLine(ml);
        }
    }
}
Also used : Coord(uk.me.parabola.imgfmt.app.Coord) MapLine(uk.me.parabola.mkgmap.general.MapLine) Polyline(uk.me.parabola.imgfmt.app.trergn.Polyline) Zoom(uk.me.parabola.imgfmt.app.trergn.Zoom) Point(uk.me.parabola.imgfmt.app.trergn.Point) MapPoint(uk.me.parabola.mkgmap.general.MapPoint)

Aggregations

Zoom (uk.me.parabola.imgfmt.app.trergn.Zoom)6 Point (uk.me.parabola.imgfmt.app.trergn.Point)5 MapPoint (uk.me.parabola.mkgmap.general.MapPoint)5 ExitException (uk.me.parabola.imgfmt.ExitException)3 Area (uk.me.parabola.imgfmt.app.Area)2 Coord (uk.me.parabola.imgfmt.app.Coord)2 Subdivision (uk.me.parabola.imgfmt.app.trergn.Subdivision)2 LevelInfo (uk.me.parabola.mkgmap.general.LevelInfo)2 FileNotFoundException (java.io.FileNotFoundException)1 ArrayList (java.util.ArrayList)1 FileExistsException (uk.me.parabola.imgfmt.FileExistsException)1 FileNotWritableException (uk.me.parabola.imgfmt.FileNotWritableException)1 FileSystemParam (uk.me.parabola.imgfmt.FileSystemParam)1 Map (uk.me.parabola.imgfmt.app.map.Map)1 MapReader (uk.me.parabola.imgfmt.app.map.MapReader)1 Polygon (uk.me.parabola.imgfmt.app.trergn.Polygon)1 Polyline (uk.me.parabola.imgfmt.app.trergn.Polyline)1 MapExitPoint (uk.me.parabola.mkgmap.general.MapExitPoint)1 MapLine (uk.me.parabola.mkgmap.general.MapLine)1 MapShape (uk.me.parabola.mkgmap.general.MapShape)1