/* * Copyright (C) 2009. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 or * version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ package uk.me.parabola.imgfmt.app.lbl; import static uk.me.parabola.imgfmt.app.Label.NULL_LABEL; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import uk.me.parabola.imgfmt.Utils; import uk.me.parabola.imgfmt.app.BufferedImgFileReader; import uk.me.parabola.imgfmt.app.ImgFile; import uk.me.parabola.imgfmt.app.ImgFileReader; import uk.me.parabola.imgfmt.app.Label; import uk.me.parabola.imgfmt.app.Section; import uk.me.parabola.imgfmt.app.labelenc.CharacterDecoder; import uk.me.parabola.imgfmt.app.labelenc.CodeFunctions; import uk.me.parabola.imgfmt.app.labelenc.DecodedText; import uk.me.parabola.imgfmt.app.trergn.Subdivision; import uk.me.parabola.imgfmt.fs.ImgChannel; import uk.me.parabola.log.Logger; /** * The file that holds all the labels for the map. * * There are also a number of sections that hold country, * region, city, etc. records. * * The main focus of mkgmap is creating files, there are plenty of applications * that read and display the data, reading is implemented only to the * extent required to support creating the various auxiliary files etc. * * @author Steve Ratcliffe */ public class LBLFileReader extends ImgFile { private CharacterDecoder textDecoder = CodeFunctions.getDefaultDecoder(); private final LBLHeader header = new LBLHeader(); private final Int2ObjectOpenHashMap