Class MapFileHeader

java.lang.Object
org.oscim.tiling.source.mapfile.header.MapFileHeader

public class MapFileHeader extends Object
Reads and validates the header data from a binary map file.
  • Constructor Details

    • MapFileHeader

      public MapFileHeader()
  • Method Details

    • getMapFileInfo

      public MapFileInfo getMapFileInfo()
      Returns:
      a MapFileInfo containing the header data.
    • getQueryZoomLevel

      public byte getQueryZoomLevel(byte zoomLevel)
      Parameters:
      zoomLevel - the originally requested zoom level.
      Returns:
      the closest possible zoom level which is covered by a sub-file.
    • getSubFileParameter

      public SubFileParameter getSubFileParameter(int queryZoomLevel)
      Parameters:
      queryZoomLevel - the zoom level for which the sub-file parameters are needed.
      Returns:
      the sub-file parameters for the given zoom level.
    • readHeader

      public TileSource.OpenResult readHeader(ReadBuffer readBuffer, long fileSize) throws IOException
      Reads and validates the header block from the map file.
      Parameters:
      readBuffer - the ReadBuffer for the file data.
      fileSize - the size of the map file in bytes.
      Returns:
      a FileOpenResult containing an error message in case of a failure.
      Throws:
      IOException - if an error occurs while reading the file.