public class MapDatabase extends java.lang.Object implements ITileDataSource
| Modifier and Type | Field and Description |
|---|---|
static int |
SIMPLIFICATION_MAX_ZOOM |
static int |
SIMPLIFICATION_MIN_ZOOM
Reduce points on-the-fly while reading from map files.
|
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 |
|---|
MapDatabase(MapFileTileSource tileSource) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Implementations should cancel their IO work and return
|
void |
dispose()
Implementations should cancel and release all resources
|
MapFileTileSource |
getTileSource() |
void |
query(MapTile tile,
ITileDataSink sink) |
MapReadResult |
readLabels(Tile tile)
Reads only labels for tile.
|
MapReadResult |
readLabels(Tile upperLeft,
Tile lowerRight)
Reads data for an area defined by the tile in the upper left and the tile in
the lower right corner.
|
MapReadResult |
readMapData(Tile tile)
Reads all map data for the area covered by the given tile at the tile zoom level.
|
MapReadResult |
readMapData(Tile upperLeft,
Tile lowerRight)
Reads data for an area defined by the tile in the upper left and the tile in
the lower right corner.
|
MapReadResult |
readPoiData(Tile tile)
Reads only POI data for tile.
|
MapReadResult |
readPoiData(Tile upperLeft,
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(int minZoom,
int maxZoom)
Restricts returns of data to zoom level range specified.
|
boolean |
supportsTile(Tile tile)
Returns true if MapDatabase contains tile.
|
boolean |
wayAsLabelTagFilter(java.util.List<Tag> tags)
Returns true if a way should be included in the result set for readLabels()
By default only ways with names, house numbers or a ref are included in the result set
of readLabels().
|
public static boolean wayFilterEnabled
public static int wayFilterDistance
public static int SIMPLIFICATION_MIN_ZOOM
public static int SIMPLIFICATION_MAX_ZOOM
public MapDatabase(MapFileTileSource tileSource) throws java.io.IOException
java.io.IOExceptionpublic MapFileTileSource getTileSource()
public void query(MapTile tile, ITileDataSink sink)
query in interface ITileDataSourcetile - the tile to load.sink - the callback to handle the extracted map elements.public void dispose()
ITileDataSourcedispose in interface ITileDataSourcepublic void cancel()
ITileDataSourcecancel in interface ITileDataSourcepublic MapReadResult readLabels(Tile tile)
tile - tile for which data is requested.public MapReadResult readLabels(Tile upperLeft, Tile lowerRight)
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 MapReadResult readMapData(Tile tile)
tile - defines area and zoom level of read map data.public MapReadResult readMapData(Tile upperLeft, Tile lowerRight)
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 MapReadResult readPoiData(Tile tile)
tile - tile for which data is requested.public MapReadResult readPoiData(Tile upperLeft, Tile lowerRight)
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(int minZoom,
int maxZoom)
minZoom - minimum zoom level supportedmaxZoom - maximum zoom level supportedpublic boolean supportsTile(Tile tile)
tile - tile to be rendered.public boolean wayAsLabelTagFilter(java.util.List<Tag> tags)
tags - the tags associated with the way