public class MapTileMaker extends ImageServer
The properties look much like the ImageServer properties, with a couple of additional values:
### MapTileMaker/ImageServer properties ### antialiasing=false # Image formatter definition formatters=formatter1 # Layer definitions for layers that are available for zoom levels layers=layer1 layer2 ... rootDir=Path to top level directory for tiles zoomLevels=zoom1 zoom2 formatter1=.class=com.bbn.openmap.image.PNG32ImageFormatter layer1.class=com.bbn.openmap.layer.shape.ShapeLayer # ... layer1 properties follow, see layer docs for specific properties for that layer # Then, for each zoom level zoom1.class=com.bbn.openmap.image.ZoomLevelInfo #Optional, to limit tile areas created, in sets of 4, must be in lat,lon order zoom1.bounds=lat lon lat lon zoom1.description=Tiles for zoom level 4 #Marker names for layers to be rendered, the property prefixes for the layers held by TileMaker zoom1.layers=layer1 layer2 zoom1.name=ZoomLayerInfo 4 zoom1.zoomLevel=4 # If defined, copies of zoomLevel tiles will be scaled through range level. zoom1.range=0 # and repeat for every zoomLevel defined
Modifier and Type | Field and Description |
---|---|
protected MapTileCoordinateTransform |
mtcTransform |
static java.lang.String |
ROOT_DIRECTORY_PROPERTY |
protected java.lang.String |
rootDir |
protected int |
TILE_SIZE |
static java.lang.String |
ZOOM_LEVELS_PROPERTY |
protected java.util.List<ZoomLevelMaker> |
zoomLevels |
AntiAliasingProperty, background, BackgroundProperty, doAntiAliasing, formatter, imageFormatters, ImageFormattersProperty, ImageServerLayersProperty, layers, logger, OpenMapPrefix, projectionFactory, propertiesPrefix
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Modifier | Constructor and Description |
---|---|
protected |
MapTileMaker()
Empty constructor that expects to be configured later.
|
|
MapTileMaker(Layer[] layers,
ImageFormatter formatter)
Create an TileMaker from an array of Layers and an ImageFormatter.
|
|
MapTileMaker(java.util.Properties props)
To create the TileMaker, you hand it a set of properties that let it
create an array of layers, and also to set the properties for those
layers.
|
|
MapTileMaker(java.lang.String prefix,
java.util.Properties props)
Same as the other constructor, except that the properties can have a
prefix in front of them.
|
|
MapTileMaker(java.lang.String prefix,
java.util.Properties props,
java.util.Map<java.lang.String,Layer> instantiatedLayers)
Create an TileMaker that should be configured with a Properties file.
|
Modifier and Type | Method and Description |
---|---|
void |
createDefaultZoomLevels(int maxZoomLevel) |
java.util.Properties |
getProperties(java.util.Properties props)
Part of the PropertyConsumer interface.
|
java.util.Properties |
getPropertyInfo(java.util.Properties props)
Part of the PropertyConsumer interface.
|
java.lang.String |
getRootDir() |
java.util.List<ZoomLevelMaker> |
getZoomLevels() |
java.awt.geom.Point2D |
latLonToTileUV(java.awt.geom.Point2D latlon,
int zoom) |
java.awt.geom.Point2D |
latLonToTileUV(java.awt.geom.Point2D latlon,
int zoom,
java.awt.geom.Point2D ret) |
static void |
main(java.lang.String[] args) |
byte[] |
makeTile(double uvx,
double uvy,
int zoomLevel,
java.util.List<Layer> layers,
Proj proj,
java.awt.Paint background)
Creating a tile more freely, when you have a set of layers you want to
draw into the tile.
|
byte[] |
makeTile(double uvx,
double uvy,
ZoomLevelMaker zoomInfo,
Proj proj)
Creating the tile using the ImageServer methodology, knowing that the
MapTileMaker has been configured with an openmap.properties.file and
knows about layers and their marker names.
|
java.lang.String |
makeTileFile(double uvx,
double uvy,
ZoomLevelMaker zoomInfo,
Proj proj)
The main call to make for a tile to be created.
|
void |
makeTiles()
Main call to make a set of tiles.
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Set the layers and image type in the properties.
|
void |
setRootDir(java.lang.String rootDir) |
void |
setZoomLevels(java.util.List<ZoomLevelMaker> zoomLevels) |
LatLonPoint |
tileUVToLatLon(java.awt.geom.Point2D tileUV,
int zoom) |
LatLonPoint |
tileUVToLatLon(java.awt.geom.Point2D tileUV,
int zoom,
LatLonPoint ret) |
calculateVisibleLayerMask, createGraphics, createImage, createImage, createImage, createImage, createImage, createImage, createImageFile, createImageFromLayers, createImageFromLayers, getBackground, getBackground, getDoAntiAliasing, getFormattedImage, getFormatter, getFormatters, getFormatters, getLayers, getLayers, getLayers, getMaskedLayers, getProjectionFactory, getPropertyPrefix, getTransparent, setBackground, setDoAntiAliasing, setFormatter, setFormatter, setFormatters, setLayers, setProjectionFactory, setProperties, setProperties, setPropertyPrefix, setTransparent, writeImageFile
public static final java.lang.String ROOT_DIRECTORY_PROPERTY
public static final java.lang.String ZOOM_LEVELS_PROPERTY
protected java.lang.String rootDir
protected java.util.List<ZoomLevelMaker> zoomLevels
protected MapTileCoordinateTransform mtcTransform
protected int TILE_SIZE
protected MapTileMaker()
public MapTileMaker(java.util.Properties props)
public MapTileMaker(java.lang.String prefix, java.util.Properties props)
public MapTileMaker(java.lang.String prefix, java.util.Properties props, java.util.Map<java.lang.String,Layer> instantiatedLayers)
public MapTileMaker(Layer[] layers, ImageFormatter formatter)
layers
- the array of layers.formatter
- the ImageFormatter to use for the output image format.public void setProperties(java.lang.String prefix, java.util.Properties props)
ImageServer
setProperties
in interface PropertyConsumer
setProperties
in class ImageServer
prefix
- 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)
ImageServer
getProperties
in interface PropertyConsumer
getProperties
in class ImageServer
props
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.public java.util.Properties getPropertyInfo(java.util.Properties props)
ImageServer
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class ImageServer
props
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.public byte[] makeTile(double uvx, double uvy, ZoomLevelMaker zoomInfo, Proj proj)
uvx
- uv x pixel coordinateuvy
- uv y pixel coordinatezoomInfo
- zoom level for image tileproj
- projection for tilepublic byte[] makeTile(double uvx, double uvy, int zoomLevel, java.util.List<Layer> layers, Proj proj, java.awt.Paint background)
uvx
- uv x pixel coordinateuvy
- uv y pixel coordinatezoomLevel
- zoom level for tilelayers
- layers to include in imageproj
- projection for tilebackground
- the paint to use for the background of the image.public java.lang.String makeTileFile(double uvx, double uvy, ZoomLevelMaker zoomInfo, Proj proj) throws java.io.IOException
uvx
- uvy
- zoomInfo
- proj
- java.io.IOException
public void makeTiles()
public java.lang.String getRootDir()
public void setRootDir(java.lang.String rootDir)
public java.util.List<ZoomLevelMaker> getZoomLevels()
public void setZoomLevels(java.util.List<ZoomLevelMaker> zoomLevels)
public void createDefaultZoomLevels(int maxZoomLevel)
public java.awt.geom.Point2D latLonToTileUV(java.awt.geom.Point2D latlon, int zoom)
latlon
- a Point2D whose x component is the longitude and y
component is the latitudezoom
- Tile Map Service (TMS) style zoom level (0-19 usually)public java.awt.geom.Point2D latLonToTileUV(java.awt.geom.Point2D latlon, int zoom, java.awt.geom.Point2D ret)
public LatLonPoint tileUVToLatLon(java.awt.geom.Point2D tileUV, int zoom)
tileUV
- a Point2D whose x,y coordinates represent the distance in
number of tiles (each 256x256) from the origin (where the origin
is 90lat,-180lon)zoom
- Tile Map Service (TMS) style zoom level (0-19 usually)public LatLonPoint tileUVToLatLon(java.awt.geom.Point2D tileUV, int zoom, LatLonPoint ret)
public static void main(java.lang.String[] args)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details