public class MapFile
extends org.mapsforge.map.datastore.MapDataStore
Modifier and Type | Field and Description |
---|---|
static MapFile |
TEST_MAP_FILE |
static int |
wayFilterDistance |
static boolean |
wayFilterEnabled
Way filtering reduces the number of ways returned to only those that are
relevant for the tile requested, leading to performance gains, but can
cause line clipping artifacts (particularly at higher zoom levels).
|
Constructor and Description |
---|
MapFile(java.io.File mapFile)
Opens the given map file, reads its header data and validates them.
|
MapFile(java.nio.channels.FileChannel mapFileChannel,
long lastModified,
java.lang.String language)
Opens the given map file channel, reads its header data and validates them.
|
MapFile(java.io.File mapFile,
java.lang.String language)
Opens the given map file, reads its header data and validates them.
|
MapFile(java.lang.String mapPath)
Opens the given map file, reads its header data and validates them.
|
MapFile(java.lang.String mapPath,
java.lang.String language)
Opens the given map file, reads its header data and validates them.
|
Modifier and Type | Method and Description |
---|---|
org.mapsforge.core.model.BoundingBox |
boundingBox() |
void |
close() |
long |
getDataTimestamp(org.mapsforge.core.model.Tile tile)
Returns the creation timestamp of the map file.
|
MapFileHeader |
getMapFileHeader() |
MapFileInfo |
getMapFileInfo() |
java.lang.String[] |
getMapLanguages() |
org.mapsforge.map.datastore.MapReadResult |
readLabels(org.mapsforge.core.model.Tile tile)
Reads only labels for tile.
|
org.mapsforge.map.datastore.MapReadResult |
readLabels(org.mapsforge.core.model.Tile upperLeft,
org.mapsforge.core.model.Tile lowerRight)
Reads data for an area defined by the tile in the upper left and the tile in
the lower right corner.
|
org.mapsforge.map.datastore.MapReadResult |
readMapData(org.mapsforge.core.model.Tile tile)
Reads all map data for the area covered by the given tile at the tile zoom level.
|
org.mapsforge.map.datastore.MapReadResult |
readMapData(org.mapsforge.core.model.Tile upperLeft,
org.mapsforge.core.model.Tile lowerRight)
Reads data for an area defined by the tile in the upper left and the tile in
the lower right corner.
|
org.mapsforge.map.datastore.MapReadResult |
readPoiData(org.mapsforge.core.model.Tile tile)
Reads only POI data for tile.
|
org.mapsforge.map.datastore.MapReadResult |
readPoiData(org.mapsforge.core.model.Tile upperLeft,
org.mapsforge.core.model.Tile lowerRight)
Reads POI data for an area defined by the tile in the upper left and the tile in
the lower right corner.
|
void |
restrictToZoomRange(byte minZoom,
byte maxZoom)
Restricts returns of data to zoom level range specified.
|
org.mapsforge.core.model.LatLong |
startPosition() |
java.lang.Byte |
startZoomLevel() |
boolean |
supportsTile(org.mapsforge.core.model.Tile tile) |
public static final MapFile TEST_MAP_FILE
public static boolean wayFilterEnabled
public static int wayFilterDistance
public MapFile(java.io.File mapFile)
mapFile
- the map file.MapFileException
- if the given map file is null or invalid.public MapFile(java.io.File mapFile, java.lang.String language)
mapFile
- the map file.language
- the language to use (may be null).MapFileException
- if the given map file is null or invalid.public MapFile(java.nio.channels.FileChannel mapFileChannel, long lastModified, java.lang.String language)
mapFileChannel
- the map file channel.language
- the language to use (may be null).MapFileException
- if the given map file channel is null or invalid.public MapFile(java.lang.String mapPath)
mapPath
- the path of the map file.MapFileException
- if the given map file is null or invalid.public MapFile(java.lang.String mapPath, java.lang.String language)
mapPath
- the path of the map file.language
- the language to use (may be null).MapFileException
- if the given map file is null or invalid or IOException if the file
cannot be opened.public org.mapsforge.core.model.BoundingBox boundingBox()
boundingBox
in class org.mapsforge.map.datastore.MapDataStore
public void close()
close
in class org.mapsforge.map.datastore.MapDataStore
public long getDataTimestamp(org.mapsforge.core.model.Tile tile)
getDataTimestamp
in class org.mapsforge.map.datastore.MapDataStore
tile
- not used, as all tiles will shared the same creation date.public MapFileHeader getMapFileHeader()
public MapFileInfo getMapFileInfo()
public java.lang.String[] getMapLanguages()
public org.mapsforge.map.datastore.MapReadResult readLabels(org.mapsforge.core.model.Tile tile)
readLabels
in class org.mapsforge.map.datastore.MapDataStore
tile
- tile for which data is requested.public org.mapsforge.map.datastore.MapReadResult readLabels(org.mapsforge.core.model.Tile upperLeft, org.mapsforge.core.model.Tile lowerRight)
readLabels
in class org.mapsforge.map.datastore.MapDataStore
upperLeft
- tile that defines the upper left corner of the requested area.lowerRight
- tile that defines the lower right corner of the requested area.public org.mapsforge.map.datastore.MapReadResult readMapData(org.mapsforge.core.model.Tile tile)
readMapData
in class org.mapsforge.map.datastore.MapDataStore
tile
- defines area and zoom level of read map data.public org.mapsforge.map.datastore.MapReadResult readMapData(org.mapsforge.core.model.Tile upperLeft, org.mapsforge.core.model.Tile lowerRight)
readMapData
in class org.mapsforge.map.datastore.MapDataStore
upperLeft
- tile that defines the upper left corner of the requested area.lowerRight
- tile that defines the lower right corner of the requested area.public org.mapsforge.map.datastore.MapReadResult readPoiData(org.mapsforge.core.model.Tile tile)
readPoiData
in class org.mapsforge.map.datastore.MapDataStore
tile
- tile for which data is requested.public org.mapsforge.map.datastore.MapReadResult readPoiData(org.mapsforge.core.model.Tile upperLeft, org.mapsforge.core.model.Tile lowerRight)
readPoiData
in class org.mapsforge.map.datastore.MapDataStore
upperLeft
- tile that defines the upper left corner of the requested area.lowerRight
- tile that defines the lower right corner of the requested area.public void restrictToZoomRange(byte minZoom, byte maxZoom)
minZoom
- minimum zoom level supportedmaxZoom
- maximum zoom level supportedpublic org.mapsforge.core.model.LatLong startPosition()
startPosition
in class org.mapsforge.map.datastore.MapDataStore
public java.lang.Byte startZoomLevel()
startZoomLevel
in class org.mapsforge.map.datastore.MapDataStore
public boolean supportsTile(org.mapsforge.core.model.Tile tile)
supportsTile
in class org.mapsforge.map.datastore.MapDataStore