|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.dataAccess.mapTile.SimpleEmptyTileHandler
com.bbn.openmap.dataAccess.mapTile.ShpFileEmptyTileHandler
com.bbn.openmap.dataAccess.mapTile.WholeWorldTileHandler
public class WholeWorldTileHandler
The WholeWorldTileHandler is a special EmptyTileHandler that manages a special set of jar files containing tiles that cover the entire earth. If you put all of the tiles from zoom levels 0-12 into a jar file, you end up with a 5Gb jar, and java doesn't handle it. Having zoom levels 0-14 on disk takes up 30Gb without being compressed.
This class, run as an application, organizes tiles into several jar files, depending on their zoom level and location. All tiles for the world in zoom levels 0-10 are placed in a single jar file. For all other zoom levels, they are placed together geographically, based on the tile boundaries of some higher level (zoom level 3 is the default, higher numbers might be chosen if tiles are created for higher zoom levels than 15).
This class is consulted when the MapTileFactory can't find a map tile. Since this class is an EmptyTileHandler, it is given free reign to return a tile for the missing one. Instead of assuming that the tiles don't exist and a quick replacement needs to be created, this EmtpyTileHandler assumes that the proper jar file hasn't been loaded yet, which is why the tile wasn't found as a resource. It uses the ux, uv, and zoom level for the tile to figure out what jar it would have been in, and checks to see if that jar has been added to the classpath. If the jar has been added, then the tile doesn't exist. If the jar needs to be added, it is and then the tile retrieval starts.
| Nested Class Summary | |
|---|---|
static class |
WholeWorldTileHandler.Builder
The builder class takes a map tile directory and creates a set of jars from it, divided so that the WholeWorldTileHandler can deal with it. |
| Field Summary | |
|---|---|
static int |
DEFAULT_SUBJAR_DEF_ZOOMLEVEL
|
static int |
DEFAULT_WORLDWIDE_ZOOMLEVEL
|
protected java.util.Set<java.lang.String> |
loadedJars
|
static java.lang.String |
PARENT_JAR_NAME_PROPERTY
|
protected java.lang.String |
parentJarName
|
protected java.lang.String |
rootDirForJars
|
protected int |
subFrameDefZoomLevel
|
static java.lang.String |
SUBJAR_ZOOMLEVEL_PROPERTY
|
static java.lang.String |
WORLDWIDE_ZOOMLEVEL_PROPERTY
|
protected int |
worldWideZoomLevel
|
| Fields inherited from class com.bbn.openmap.dataAccess.mapTile.ShpFileEmptyTileHandler |
|---|
geoIndex, LAND_ATTRIBUTES_PROPERTY, landAttributes, SHP_FILE_PROPERTY |
| Fields inherited from class com.bbn.openmap.dataAccess.mapTile.SimpleEmptyTileHandler |
|---|
BACKGROUND_PROPERTY, backgroundAtts, logger, NO_COVERAGE_ZOOM_PROPERTY, noCoverageAtts, noCoverageZoom, prefix, TILE_SIZE |
| Fields inherited from interface com.bbn.openmap.PropertyConsumer |
|---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
| Constructor Summary | |
|---|---|
WholeWorldTileHandler()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
buildSubJarName(java.lang.String parentJarNme,
double x,
double y)
|
java.awt.image.BufferedImage |
getImageForEmptyTile(java.lang.String imagePath,
int x,
int y,
int zoomLevel,
MapTileCoordinateTransform mtcTransform,
Projection proj)
The main call from the MapTileFactory to return something for the given missing tile. |
java.lang.String |
getParentJarName()
Get the name of the jar with worldwide coverage, for zoom levels 0-worldWideZoomLevel. |
java.util.Properties |
getProperties(java.util.Properties props)
Method to fill in a Properties object, reflecting the current values of the PropertyConsumer. |
int |
getSubFrameDefZoomLevel()
Get the tile zoom level that the subjar borders are based on. |
int |
getWorldWideZoomLevel()
Get the maximum tile zoom level that is contained in the worldwide jar. |
protected boolean |
loadJar(java.lang.String jarFileName)
Load the jar if necessary. |
static void |
main(java.lang.String[] args)
Takes arguments for source tile directory, target directory, and option sub-jar zoom level, and creates jars in the right place with expected tiles. |
void |
setParentJarName(java.lang.String parentJarName)
Set the name of the jar with worldwide coverage, for tiles with zoom levels 0-worldWideZoomLevel. |
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Method to set the properties in the PropertyConsumer. |
void |
setSubFrameDefZoomLevel(int subFrameZoomLevel)
Set the tile zoom level that the subjar borders will be based on. |
void |
setWorldWideZoomLevel(int worldWideZoomLevel)
Set the maximum tile zoom level that is contained in the worldwide jar. |
| Methods inherited from class com.bbn.openmap.dataAccess.mapTile.ShpFileEmptyTileHandler |
|---|
getGeoIndex, getLandAttributes, isOverLand, setGeoIndex, setGeoIndex, setLandAttributes |
| Methods inherited from class com.bbn.openmap.dataAccess.mapTile.SimpleEmptyTileHandler |
|---|
getBackgroundAtts, getNoCoverageAtts, getNoCoverageZoom, getPropertyInfo, getPropertyPrefix, setBackgroundAtts, setNoCoverageAtts, setNoCoverageZoom, setProperties, setPropertyPrefix |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SUBJAR_ZOOMLEVEL_PROPERTY
public static final java.lang.String WORLDWIDE_ZOOMLEVEL_PROPERTY
public static final java.lang.String PARENT_JAR_NAME_PROPERTY
public static final int DEFAULT_SUBJAR_DEF_ZOOMLEVEL
public static final int DEFAULT_WORLDWIDE_ZOOMLEVEL
protected int subFrameDefZoomLevel
protected int worldWideZoomLevel
protected java.lang.String parentJarName
protected java.util.Set<java.lang.String> loadedJars
protected java.lang.String rootDirForJars
| Constructor Detail |
|---|
public WholeWorldTileHandler()
| Method Detail |
|---|
public java.awt.image.BufferedImage getImageForEmptyTile(java.lang.String imagePath,
int x,
int y,
int zoomLevel,
MapTileCoordinateTransform mtcTransform,
Projection proj)
EmptyTileHandler
getImageForEmptyTile in interface EmptyTileHandlergetImageForEmptyTile in class ShpFileEmptyTileHandlerimagePath - the path of the missing tile that is going to be used as
cache lookup later.x - the uv x coordinate of the tile.y - the uv y coordinate of the tile.zoomLevel - the zoom level of the tile.mtcTransform - the transform that converts x,y coordinates to
lat/lon and describes the layout of the uv tile coordinates.proj - the map projection, in case that matters what should be
returned for the empty tile.
public static java.lang.String buildSubJarName(java.lang.String parentJarNme,
double x,
double y)
protected boolean loadJar(java.lang.String jarFileName)
jarFileName - the absolute path to the jar.
public void setProperties(java.lang.String prefix,
java.util.Properties props)
PropertyConsumer
setProperties in interface PropertyConsumersetProperties in class ShpFileEmptyTileHandlerprefix - a String used by the PropertyConsumer to prepend
to each property value it wants to look up -
setList.getProperty(prefix.propertyKey). If the prefix
had already been set, then the prefix passed in should
replace that previous value.props - a Properties object that the PropertyConsumer
can use to retrieve expected properties it can use for
configuration.public java.util.Properties getProperties(java.util.Properties props)
PropertyConsumer
getProperties in interface PropertyConsumergetProperties in class ShpFileEmptyTileHandlerprops - a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.
public int getSubFrameDefZoomLevel()
public void setSubFrameDefZoomLevel(int subFrameZoomLevel)
subFrameZoomLevel - the subFrameDefZoomLevel to setpublic java.lang.String getParentJarName()
public void setParentJarName(java.lang.String parentJarName)
parentJarName - the parentJarName to setpublic int getWorldWideZoomLevel()
public void setWorldWideZoomLevel(int worldWideZoomLevel)
worldWideZoomLevel - the worldWideZoomLevel to setpublic static void main(java.lang.String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||