Class MapFileHeader
java.lang.Object
org.oscim.tiling.source.mapfile.header.MapFileHeader
Reads and validates the header data from a binary map file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbytegetQueryZoomLevel(byte zoomLevel) getSubFileParameter(int queryZoomLevel) readHeader(ReadBuffer readBuffer, long fileSize) Reads and validates the header block from the map file.
-
Constructor Details
-
MapFileHeader
public MapFileHeader()
-
-
Method Details
-
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
- Parameters:
queryZoomLevel- the zoom level for which the sub-file parameters are needed.- Returns:
- the sub-file parameters for the given zoom level.
-
readHeader
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.
-