Package gov.nasa.worldwind.ogc
Class WmsTileFactory
- java.lang.Object
-
- gov.nasa.worldwind.ogc.WmsTileFactory
-
- All Implemented Interfaces:
TileFactory
public class WmsTileFactory extends java.lang.Object implements TileFactory
Factory for constructing URLs associated with WMS Get Map requests.
-
-
Constructor Summary
Constructors Constructor Description WmsTileFactory(WmsLayerConfig config)
Constructs a level set with a specified configuration.WmsTileFactory(java.lang.String serviceAddress, java.lang.String wmsVersion, java.lang.String layerNames, java.lang.String styleNames)
Constructs a WMS Get Map URL builder with specified WMS service parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tile
createTile(Sector sector, Level level, int row, int column)
Returns a tile for a specified sector, level within aLevelSet
, and row and column within that level.java.lang.String
getCoordinateSystem()
Indicates the coordinate reference system to use in Get Map URLs.java.lang.String
getImageFormat()
Indicates the image content type to use in Get Map URLs, or null in which case the default format is assumed.java.lang.String
getLayerNames()
Indicates the comma-separated list of WMS layer names.java.lang.String
getServiceAddress()
Indicates the WMS service address used to build Get Map URLs.java.lang.String
getStyleNames()
Indicates the comma-separated list of WMS style names, or null in which case the default style is assumed.java.lang.String
getTimeString()
Indicates the time parameter to include in Get Map URLs, or null in which case no time parameter is included.java.lang.String
getWmsVersion()
Indicates the WMS protocol version.boolean
isTransparent()
Indicates whether Get Map URLs should include transparency.void
setCoordinateSystem(java.lang.String coordinateSystem)
Sets the coordinate reference system to use in Get Map URLs.void
setImageFormat(java.lang.String imageFormat)
Sets the image content type to use in Get Map URLs.void
setLayerNames(java.lang.String layerNames)
Sets the comma-separated list of WMS layer names.void
setServiceAddress(java.lang.String serviceAddress)
Sets the WMS service address used to build Get Map URLs.void
setStyleNames(java.lang.String styleNames)
Sets the comma-separated list of WMS style names.void
setTimeString(java.lang.String timeString)
Sets the time parameter to include in Get Map URLs.void
setTransparent(boolean transparent)
Sets whether Get Map URLs should include transparency.void
setWmsVersion(java.lang.String wmsVersion)
Sets the WMS protocol version.java.lang.String
urlForTile(Sector sector, int width, int height)
-
-
-
Constructor Detail
-
WmsTileFactory
public WmsTileFactory(java.lang.String serviceAddress, java.lang.String wmsVersion, java.lang.String layerNames, java.lang.String styleNames)
Constructs a WMS Get Map URL builder with specified WMS service parameters.- Parameters:
serviceAddress
- the WMS service addresswmsVersion
- the WMS protocol versionlayerNames
- comma-separated list of WMS layer namesstyleNames
- comma-separated list of WMS style names, may be null in which case the default style is assumed- Throws:
java.lang.IllegalArgumentException
- If any of the service address, the WMS protocol version, or the layer names are null
-
WmsTileFactory
public WmsTileFactory(WmsLayerConfig config)
Constructs a level set with a specified configuration. The configuration's service address, WMS protocol version, layer names and coordinate reference system must be non-null. The style names may be null, in which case the default style is assumed. The time string may be null, in which case no time parameter is included.- Parameters:
config
- the configuration for this URL builder- Throws:
java.lang.IllegalArgumentException
- If the configuration is null, or if any configuration value is invalid
-
-
Method Detail
-
getServiceAddress
public java.lang.String getServiceAddress()
Indicates the WMS service address used to build Get Map URLs.- Returns:
- the WMS service address
-
setServiceAddress
public void setServiceAddress(java.lang.String serviceAddress)
Sets the WMS service address used to build Get Map URLs.- Parameters:
serviceAddress
- the WMS service address- Throws:
java.lang.IllegalArgumentException
- if the service address is null
-
getWmsVersion
public java.lang.String getWmsVersion()
Indicates the WMS protocol version.- Returns:
- the WMS protocol version
-
setWmsVersion
public void setWmsVersion(java.lang.String wmsVersion)
Sets the WMS protocol version.- Parameters:
wmsVersion
- the WMS protocol version- Throws:
java.lang.IllegalArgumentException
- If the version is null
-
getLayerNames
public java.lang.String getLayerNames()
Indicates the comma-separated list of WMS layer names.- Returns:
- comma-separated list of WMS layer names
-
setLayerNames
public void setLayerNames(java.lang.String layerNames)
Sets the comma-separated list of WMS layer names.- Parameters:
layerNames
- comma-separated list of WMS layer names- Throws:
java.lang.IllegalArgumentException
- if the layer names are null
-
getStyleNames
public java.lang.String getStyleNames()
Indicates the comma-separated list of WMS style names, or null in which case the default style is assumed.- Returns:
- comma-separated list of WMS style names
-
setStyleNames
public void setStyleNames(java.lang.String styleNames)
Sets the comma-separated list of WMS style names. May be null in which case the default style is assumed.- Parameters:
styleNames
- comma-separated list of WMS style names
-
getCoordinateSystem
public java.lang.String getCoordinateSystem()
Indicates the coordinate reference system to use in Get Map URLs. Defaults to EPSG:4326.- Returns:
- the coordinate reference system to use
-
setCoordinateSystem
public void setCoordinateSystem(java.lang.String coordinateSystem)
Sets the coordinate reference system to use in Get Map URLs.- Parameters:
coordinateSystem
- the coordinate reference system to use- Throws:
java.lang.IllegalArgumentException
- If the coordinate system is null
-
getImageFormat
public java.lang.String getImageFormat()
Indicates the image content type to use in Get Map URLs, or null in which case the default format is assumed.- Returns:
- the image content type
-
setImageFormat
public void setImageFormat(java.lang.String imageFormat)
Sets the image content type to use in Get Map URLs. May be null in which case the default format is assumed.- Parameters:
imageFormat
- the image content type to use
-
isTransparent
public boolean isTransparent()
Indicates whether Get Map URLs should include transparency.- Returns:
- true to include transparency, false otherwise
-
setTransparent
public void setTransparent(boolean transparent)
Sets whether Get Map URLs should include transparency.- Parameters:
transparent
- true to include transparency, false otherwise
-
getTimeString
public java.lang.String getTimeString()
Indicates the time parameter to include in Get Map URLs, or null in which case no time parameter is included.- Returns:
- the time parameter to include
-
setTimeString
public void setTimeString(java.lang.String timeString)
Sets the time parameter to include in Get Map URLs. May be null in which case no time parameter is included.- Parameters:
timeString
- the time parameter to include
-
createTile
public Tile createTile(Sector sector, Level level, int row, int column)
Description copied from interface:TileFactory
Returns a tile for a specified sector, level within aLevelSet
, and row and column within that level.- Specified by:
createTile
in interfaceTileFactory
- Parameters:
sector
- the sector spanned by the tilelevel
- the level at which the tile lies within a LevelSetrow
- the row within the specified levelcolumn
- the column within the specified level- Returns:
- a tile constructed with the specified arguments
-
urlForTile
public java.lang.String urlForTile(Sector sector, int width, int height)
-
-