Class ALcdWMSProxy
- All Implemented Interfaces:
ILcdBounded
,ILcdCache
,Cloneable
ALcdWMSProxy
is an object that acts as a proxy
towards a Web Map Service (WMS).
It is used as domain object inside an ILcdModel
decoded by
TLcdOGCWMSProxyModelDecoder
and has the following roles:
- Description of the WMS server: it contains the capabilities of the WMS server,
which can be retrieved through the method
getWMSCapabilities()
. These capabilities describe the hierarchy of available layers and styles at the server, service metadata, supported formats, etc. The root of the layer hierarchy can be retrieved throughALcdOGCWMSCapabilities.getWMSRootNamedLayer(int)
. Each layer is represented by anALcdWMSNamedLayer
object, and optionally contains a set of child layers. - Configuration of the WMS client: it describes the configuration at the WMS client, namely
- the layers that should be included in a map or feature info query,
- the formats to be used for a map query or feature info query,
- the desired exception format to be used by the server to encode service exceptions,
- whether returned maps should use a transparent background color,
- any additional request parameters that should be used for the connection (e.g., proxy server configuration).
TLcdWMSStyledNamedLayerWrapper
must be added to this proxy for each desiredALcdWMSLayer
(seeaddStyledNamedLayer(TLcdWMSStyledNamedLayerWrapper)
). - Sending queries to the WMS server: it offers methods to send out a query based on the current configuration
of the layers and formats, and retrieve the result as an
InputStream
, namelycreateImageInputStream
: sends out a GetMap query,createFeatureInfoInputStream
: sends out a GetFeatureInfo query.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDimension
(TLcdOGCWMSDimensionWrapper aDimension) Adds a wrapper class for a dimension having an extent to the list of dimensions to be used in the request.abstract void
addStyledNamedLayer
(TLcdWMSStyledNamedLayerWrapper aStyledNamedLayer) Adds a wrapper class for a named layer having a style to the list of layers to request from the WMS.void
Clears the cache.void
Clears all theTLcdOGCWMSDimensionWrapper
s.abstract void
Clears all theTLcdWMSStyledNamedLayerWrapper
s.clone()
Creates and returns a shallow copy of this object.abstract InputStream
createFeatureInfoInputStream
(int aWidth, int aHeight, ILcdXYWorldReference aXYWorldReference, ILcdBounds aBounds, Color aBackgroundColor, int aX, int aY, int aFeatureCount) Deprecated.abstract InputStream
createFeatureInfoInputStream
(TLcdWMSGetFeatureInfoContext aGetFeatureInfoContext, TLcdWMSGetFeatureInfoParameters aGetFeatureInfoParameters) Sends aGetFeatureInfo
request with the given parameters to the WMS configured in the capabilities (seegetWMSCapabilities()
), and returns the result as anInputStream
object.createImage
(int aWidth, int aHeight, ILcdXYWorldReference aXYWorldReference, ILcdBounds aBounds, Color aBackgroundColor) Deprecated.Use the methodcreateImageInputStream
, to which this default implementation delegates.abstract InputStream
createImageInputStream
(int aWidth, int aHeight, ILcdXYWorldReference aXYWorldReference, ILcdBounds aBounds, Color aBackgroundColor) Deprecated.usecreateImageInputStream(TLcdWMSGetMapContext)
insteadabstract InputStream
createImageInputStream
(TLcdWMSGetMapContext aGetMapContext) Sends aGetMap
request with the given parameters to the WMS configured in the capabilities (seegetWMSCapabilities()
), and returns the result as anInputStream
object.final ALcdWMSNamedLayer
findWMSNamedLayer
(String aNamedLayerName) Returns the WMS layer from the capabilities for which the uniquelayer name
equals the given name.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.getCachedObject
(Object aKey) Looks up and returns the cached Object corresponding to the given key.getDimension
(int aIndex) Returns theTLcdOGCWMSDimensionWrapper
at the specified index.int
Returns the number of dimension objects within the request to the WMS.Returns the exception format value that is used by the WMS to encode service exception reports.Returns the exception handler of thisALcdWMSProxy
Returns the feature info format value that is used when sendingGetFeatureInfo
requests to the WMS.Returns the map format value that is used when sendingGetMap
requests to the WMS.final List
<ALcdWMSNamedLayer> getNamedLayers
(boolean aOnlyVisible, boolean aOnlyQueryable) This method returns a list of named layers that are registered on this proxy object.double
Returns the configured pixel size.Returns the Styled Layer Descriptor (SLD) which will be sent along with requests.Return the URL pointing to a valid Styled Layer Descriptor (SLD), which will be sent along with requests.abstract TLcdWMSStyledNamedLayerWrapper
getStyledNamedLayer
(int aIndex) Returns theTLcdWMSStyledNamedLayerWrapper
at an index.abstract int
Returns the number of styled named layer objects within the request to the WMS.abstract String
getSupportedMapFormat
(int aIndex) Returns the supported map format at the given index.abstract int
Returns the number of map formats supported by the WMS.abstract ALcdOGCWMSCapabilities
Returns anALcdOGCWMSCapabilities
instance that contains the capabilities of the WMS.abstract ALcdWMSNamedLayer
getWMSRootNamedLayer
(int aIndex) Returns the top level layer at a given index.abstract int
Returns the number of top levelALcdWMSNamedLayer
instances.void
insertIntoCache
(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.boolean
Returns if the WMS is request to return an image with a transparent background.abstract boolean
Returns whether the images returned by the WMS are cached.boolean
Returns true if the bounding box coordinates should be inverted in case the world reference of the request is EPSG:4326 and the WMS version is 1.3.0.abstract boolean
isSupportedXYworldReference
(ILcdXYWorldReference aXYWorldReference, ALcdWMSNamedLayer aWMSNamedLayer) Tests if the givenILcdXYWorldReference
is supported for the given layer.abstract void
moveStyledNamedLayer
(TLcdWMSStyledNamedLayerWrapper aStyledNamedLayer, int aToIndex) Moves theTLcdWMSStyledNamedLayerWrapper
from its current position to another specified index.abstract void
putAdditionalParameter
(String aParameterName, String aParameterValue) Sets an additional parameter for connecting to the WMS.abstract void
removeAdditionalParameter
(String aParameterName) Removes the additional parameter with the given name.removeCachedObject
(Object aKey) Looks up and removes the cached Object corresponding to the given key.void
removeDimension
(int aIndex) Removes theTLcdOGCWMSDimensionWrapper
at the specified index.abstract void
removeStyledNamedLayer
(int aIndex) Removes theTLcdWMSStyledNamedLayerWrapper
at an index.void
setBackgroundImageTransparent
(boolean aTransparent) Sets if the WMS should return an image whose background is transparent.abstract void
setCacheImage
(boolean aCacheImage) Sets whether the images returned by the WMS should be cached.void
setExceptionFormat
(String aExceptionFormat) Sets the exception format value to be used by the WMS to encode service exception reports.void
setExceptionHandler
(ILcdExceptionHandler aExceptionHandler) Sets the exception handler which is to be used by this proxy.void
setFeatureInfoFormat
(String aFeatureInfoFormat) Sets the feature info format value to be used when sendingGetFeatureInfo
requests to the WMS.void
setInvertXYForEPSG4326
(boolean aInvertXYForEPSG4326) Sets whether the bounding box coordinates should be inverted in case the world reference of the request is EPSG:4326 and the WMS version is 1.3.0.void
setMapFormat
(String aMapFormat) Sets the map format value to be used when sendingGetMap
requests to the WMS.void
setPixelSize
(double aPixelSize) Sets the pixel size that should be passed to the WMS server.void
Sets a Styled Layer Descriptor (SLD) to send along with requests.void
Sets an URL pointing to a valid Styled Layer Descriptor (SLD), to send along with requests.static TLcdWMSDataSource
toDataSource
(ALcdWMSProxy aWMSProxy) Converts the settings configured in the{@link ALcdWMSProxy WMS proxy}
object into aWMS data source
representation.
-
Constructor Details
-
ALcdWMSProxy
public ALcdWMSProxy()
-
-
Method Details
-
createImage
public Image createImage(int aWidth, int aHeight, ILcdXYWorldReference aXYWorldReference, ILcdBounds aBounds, Color aBackgroundColor) Deprecated.Use the methodcreateImageInputStream
, to which this default implementation delegates.Sends aGetMap
request with the given parameters to the WMS server configured in the capabilities (seegetWMSCapabilities()
), and returns the result as anImage
object, if recognized as such. If the result is not an image (e.g., a service exception or an HTTP error),null
is returned.This method delegates by default to
createImageInputStream(int, int, com.luciad.view.ILcdXYWorldReference, com.luciad.shape.ILcdBounds, java.awt.Color)
.- Parameters:
aWidth
- the width of the map.aHeight
- the height of the map.aXYWorldReference
- the reference in which the map should be returned.aBounds
- the area of interest, specified in the reference of the map to be returned.aBackgroundColor
- the background color to use for the map.- Returns:
- an
Image
containing the map returned by the WMS, ornull
if the result is not recognized.
-
createImageInputStream
public abstract InputStream createImageInputStream(int aWidth, int aHeight, ILcdXYWorldReference aXYWorldReference, ILcdBounds aBounds, Color aBackgroundColor) throws IOException Deprecated.usecreateImageInputStream(TLcdWMSGetMapContext)
insteadSends aGetMap
request with the given parameters to the WMS configured in the capabilities (seegetWMSCapabilities()
), and returns the result as anInputStream
object.- Parameters:
aWidth
- the width of the map.aHeight
- the height of the map.aXYWorldReference
- the reference in which the map should be returned.aBounds
- the area of interest, specified in the reference of the map to be returned.aBackgroundColor
- the background color to use for the map.- Returns:
- an
InputStream
containing the result of a WMSGetMap
request with the given parameters. - Throws:
TLcdOGCWMSServiceException
- when the server sends a service exception report.TLcdOGCWMSHttpException
- when a HTTP error is received.TLcdOGCWMSException
- in all other cases (e.g. incorrect request properties, unrecognized result of the server, ...).IOException
-
createImageInputStream
public abstract InputStream createImageInputStream(TLcdWMSGetMapContext aGetMapContext) throws IOException Sends aGetMap
request with the given parameters to the WMS configured in the capabilities (seegetWMSCapabilities()
), and returns the result as anInputStream
object.- Parameters:
aGetMapContext
- the GetMap context- Returns:
- an
InputStream
containing the result of a WMSGetMap
request with the given parameters. - Throws:
TLcdOGCWMSServiceException
- when the server sends a service exception report.TLcdOGCWMSHttpException
- when a HTTP error is received.TLcdOGCWMSException
- in all other cases (e.g. incorrect request properties, unrecognized result of the server, ...).IOException
-
createFeatureInfoInputStream
public abstract InputStream createFeatureInfoInputStream(int aWidth, int aHeight, ILcdXYWorldReference aXYWorldReference, ILcdBounds aBounds, Color aBackgroundColor, int aX, int aY, int aFeatureCount) throws IOException Deprecated.Sends aGetFeatureInfo
request with the given parameters to the WMS configured in the capabilities (seegetWMSCapabilities()
), and returns the result as anInputStream
object.- Parameters:
aWidth
- the width of the map of interest.aHeight
- the height of the map of interest.aXYWorldReference
- the reference in which the map should be generated.aBounds
- the area of interest, specified in the reference of the generated map.aBackgroundColor
- the background color to use for the map (note: the result of aGetFeatureInfo
request can also be a map with the feature painted selected and/or labeled, instead of just textual information).aX
- the x coordinate in pixels of the point of interest.aY
- the y coordinate in pixels of the point of interest.aFeatureCount
- the maximum number of features per layer for which feature information shall be returned. If other than a positive integer, the default value 1 will be used, following the WMS specification.- Returns:
- an
InputStream
containing the result of a WMSGetFeatureInfo
request with the given parameters. - Throws:
TLcdOGCWMSServiceException
- when the server sends a service exception report.TLcdOGCWMSHttpException
- when a HTTP error is received.TLcdOGCWMSException
- in all other cases (e.g. incorrect request properties, unrecognized result of the server, ...).IOException
-
createFeatureInfoInputStream
public abstract InputStream createFeatureInfoInputStream(TLcdWMSGetFeatureInfoContext aGetFeatureInfoContext, TLcdWMSGetFeatureInfoParameters aGetFeatureInfoParameters) throws IOException Sends a
GetFeatureInfo
request with the given parameters to the WMS configured in the capabilities (seegetWMSCapabilities()
), and returns the result as anInputStream
object. It is possible to specify additional query parameters using the givenTLcdWMSGetFeatureInfoParameters
object.When the given
TLcdWMSGetFeatureInfoParameters
object doesn't specify a certain parameter, a default parameter is used. For example, when not specifying a feature info format, the feature info format set on this object will be used. When not specifying a set of layers to query, all layers will be queried.- Parameters:
aGetFeatureInfoContext
- The GetFeatureInfo contextaGetFeatureInfoParameters
- The (optional) GetFeatureInfo parameters. Should not benull
.- Returns:
- an
InputStream
containing the result of a WMSGetFeatureInfo
request with the given parameters. - Throws:
TLcdOGCWMSServiceException
- when the server sends a service exception report.TLcdOGCWMSHttpException
- when a HTTP error is received.TLcdOGCWMSException
- in all other cases (e.g. incorrect request properties, unrecognized result of the server, ...).IOException
-
getMapFormat
Returns the map format value that is used when sendingGetMap
requests to the WMS. Its value is one of the supported map formats (specified by its MIME-type).- Returns:
- the value of the mapFormat property.
- See Also:
-
setMapFormat
Sets the map format value to be used when sendingGetMap
requests to the WMS. Its value has to be one of the map formats returned byALcdOGCWMSCapabilities.getSupportedMapFormat(int)
.- Parameters:
aMapFormat
- the value of the map format property.- See Also:
-
getFeatureInfoFormat
Returns the feature info format value that is used when sendingGetFeatureInfo
requests to the WMS. Its value is one of the supported feature info formats (specified by its MIME-type).- Returns:
- the value of the mapFormat property.
- See Also:
-
setFeatureInfoFormat
Sets the feature info format value to be used when sendingGetFeatureInfo
requests to the WMS. Its value has to be one of the feature info formats returned byALcdOGCWMSCapabilities.getSupportedFeatureInfoFormat(int)
.- Parameters:
aFeatureInfoFormat
- the value of the feature info format property.- See Also:
-
getExceptionFormat
Returns the exception format value that is used by the WMS to encode service exception reports. Its value is one of the supported exception formats or null for the default.- Returns:
- the value of the exception format property.
- See Also:
-
setExceptionFormat
Sets the exception format value to be used by the WMS to encode service exception reports. Its value has to be one of the exception formats returned byALcdOGCWMSCapabilities.getSupportedExceptionFormat(int)
or null for the default exception format.- Parameters:
aExceptionFormat
- the value of the exception format property.- See Also:
-
getSupportedMapFormatCount
public abstract int getSupportedMapFormatCount()Returns the number of map formats supported by the WMS. This is equivalent withgetWMSCapabilities().getSupportedMapFormatCount()
.- Returns:
- the number of map formats supported by the WMS.
-
getSupportedMapFormat
Returns the supported map format at the given index. The format is specified by its MIME-type. This is equivalent withgetWMSCapabilities().getSupportedMapFormat(int)
.- Parameters:
aIndex
- the index of the map format to return.- Returns:
- the supported map format at a given index.
- Throws:
IndexOutOfBoundsException
- in case of an invalid index.
-
getWMSRootNamedLayerCount
public abstract int getWMSRootNamedLayerCount()Returns the number of top levelALcdWMSNamedLayer
instances. This is equivalent withgetWMSCapabilities().getWMSRootNamedLayerCount()
.- Returns:
- the number of top level
ALcdWMSNamedLayer
instances.
-
getWMSRootNamedLayer
Returns the top level layer at a given index. This is equivalent withgetWMSCapabilities().getWMSRootNamedLayer(int)
.- Parameters:
aIndex
- the index of the top level layer.- Returns:
- the top level layer at a given index.
- Throws:
IndexOutOfBoundsException
- if the index is out of bounds.
-
addStyledNamedLayer
Adds a wrapper class for a named layer having a style to the list of layers to request from the WMS. Only wrapper instances having a visible state true are requested from the WMS.- Parameters:
aStyledNamedLayer
- the styled named layer.
-
getStyledNamedLayerCount
public abstract int getStyledNamedLayerCount()Returns the number of styled named layer objects within the request to the WMS.- Returns:
- the number of styled named layer objects within the request to the WMS.
-
getStyledNamedLayer
public abstract TLcdWMSStyledNamedLayerWrapper getStyledNamedLayer(int aIndex) throws IndexOutOfBoundsException Returns theTLcdWMSStyledNamedLayerWrapper
at an index.- Parameters:
aIndex
- the index of theTLcdWMSStyledNamedLayerWrapper
.- Returns:
- the
TLcdWMSStyledNamedLayerWrapper
at an index. - Throws:
IndexOutOfBoundsException
- in case of an invalid index value.
-
moveStyledNamedLayer
public abstract void moveStyledNamedLayer(TLcdWMSStyledNamedLayerWrapper aStyledNamedLayer, int aToIndex) throws IndexOutOfBoundsException, NoSuchElementException Moves theTLcdWMSStyledNamedLayerWrapper
from its current position to another specified index.- Parameters:
aStyledNamedLayer
- theTLcdWMSStyledNamedLayerWrapper
to move.aToIndex
- the index to move to.- Throws:
IndexOutOfBoundsException
- in case of an invalid index value.NoSuchElementException
- if theTLcdWMSStyledNamedLayerWrapper
does not exists within the list.
-
removeStyledNamedLayer
Removes theTLcdWMSStyledNamedLayerWrapper
at an index.- Parameters:
aIndex
- the index of theTLcdWMSStyledNamedLayerWrapper
to remove.- Throws:
IndexOutOfBoundsException
- in case of an invalid index value.
-
clearStyledNamedLayers
public abstract void clearStyledNamedLayers()Clears all theTLcdWMSStyledNamedLayerWrapper
s. -
setStyledLayerDescriptor
Sets a Styled Layer Descriptor (SLD) to send along with requests. The specified SLD will be embedded as XML in the request.Another approach to configure an SLD is to specify an URL that points to the SLD. This is possible through the method
setStyledLayerDescriptorURL(java.net.URL)
.Only one SLD can be specified at a given time. Setting an SLD with this method therefore overrides any configured SLD URL (see
getStyledLayerDescriptorURL()
) and vice versa.- Parameters:
aSLD
- A valid SLD.- See Also:
-
getStyledLayerDescriptor
Returns the Styled Layer Descriptor (SLD) which will be sent along with requests. By default,null
is returned.- Returns:
- an SLD or
null
if no SLD has been specified.
-
setStyledLayerDescriptorURL
Sets an URL pointing to a valid Styled Layer Descriptor (SLD), to send along with requests. The URL will be included in the request, not the SLD itself. The server therefore needs to be able to access the URL, in order to use the SLD.Another approach to configure an SLD is to set an SLD domain object that will be embedded in the request itself. This is possible through the method
setStyledLayerDescriptor(com.luciad.wms.sld.model.TLcdSLDStyledLayerDescriptor)
.Only one SLD can be specified at a given time. Setting a link to an SLD with this method therefore overrides any configured SLD domain object (see
getStyledLayerDescriptor()
) and vice versa.- Parameters:
aURL
- A URL which points to a valid SLD.- See Also:
-
getStyledLayerDescriptorURL
Return the URL pointing to a valid Styled Layer Descriptor (SLD), which will be sent along with requests. By default,null
is returned.- Returns:
- an URL pointing to an SLD or
null
if no URL has been specified.
-
getNamedLayers
This method returns a list of named layers that are registered on this proxy object. The returned list contains:
- All styled named layers: see also
getStyledNamedLayer
. - All SLD layers. SLD layers are only returned when there are no registered styled named layers
and when an SLD is defined in this proxy, see
setStyledLayerDescriptor
orsetStyledLayerDescriptorURL
. In that case, it will retrieve the layers from that SLD. In case of an SLD named layer, it will be converted to anALcdWMSNamedLayer
; in case of anSLD user layer
, a dummyALcdWMSNamedLayer
will be used as placeholder, with world bounds.
- Parameters:
aOnlyVisible
-true
to only return visible named layers.aOnlyQueryable
-true
to only return queryable named layer, i.e. layers for which GetFeatureInfo requests are enabled.- Returns:
- a list of named layers that are registered on this proxy object, or an empty list if no layers are found never
null
. - Since:
- 2016.1
- All styled named layers: see also
-
addDimension
Adds a wrapper class for a dimension having an extent to the list of dimensions to be used in the request.- Parameters:
aDimension
- the dimension with the extent.
-
getDimensionCount
public int getDimensionCount()Returns the number of dimension objects within the request to the WMS.- Returns:
- the number of dimension objects within the request to the WMS.
-
getDimension
Returns theTLcdOGCWMSDimensionWrapper
at the specified index.- Parameters:
aIndex
- the index of theTLcdOGCWMSDimensionWrapper
.- Returns:
- the
TLcdOGCWMSDimensionWrapper
at the specified index. - Throws:
IndexOutOfBoundsException
- in case of an invalid index value.
-
removeDimension
public void removeDimension(int aIndex) Removes theTLcdOGCWMSDimensionWrapper
at the specified index.- Parameters:
aIndex
- the index of theTLcdOGCWMSDimensionWrapper
to remove.- Throws:
IndexOutOfBoundsException
- in case of an invalid index value.
-
clearDimensions
public void clearDimensions()Clears all theTLcdOGCWMSDimensionWrapper
s. -
setBackgroundImageTransparent
public void setBackgroundImageTransparent(boolean aTransparent) Sets if the WMS should return an image whose background is transparent. For this to be useful the requested map format should be capable of representing a transparent background.- Parameters:
aTransparent
- the new transparent property value.- See Also:
-
isBackgroundImageTransparent
public boolean isBackgroundImageTransparent()Returns if the WMS is request to return an image with a transparent background.- Returns:
- if the WMS is request to return an image with a transparent background.
- See Also:
-
setPixelSize
public void setPixelSize(double aPixelSize) Sets the pixel size that should be passed to the WMS server. If the WMS server supports thePIXELSIZE
parameter, it can take it into account when evaluation scale ranges.- Parameters:
aPixelSize
- The size of a pixel on the client screen, in mm. Should be larger than 0.
-
getPixelSize
public double getPixelSize()Returns the configured pixel size.- Returns:
- The pixel size in mm. The default value is calculated based on the resolution of the client screen.
- See Also:
-
putAdditionalParameter
public abstract void putAdditionalParameter(String aParameterName, String aParameterValue) throws IllegalArgumentException Sets an additional parameter for connecting to the WMS.- Parameters:
aParameterName
- the name of the parameter.aParameterValue
- the corresponding value.- Throws:
IllegalArgumentException
- if the parameter name is illegal.
-
removeAdditionalParameter
Removes the additional parameter with the given name.- Parameters:
aParameterName
- the name of the parameter to be removed.
-
isSupportedXYworldReference
public abstract boolean isSupportedXYworldReference(ILcdXYWorldReference aXYWorldReference, ALcdWMSNamedLayer aWMSNamedLayer) Tests if the givenILcdXYWorldReference
is supported for the given layer.- Parameters:
aXYWorldReference
- the world reference to test.aWMSNamedLayer
- the named layer to check against.- Returns:
- true if the given
ILcdXYWorldReference
is supported for the given layer.
-
getWMSCapabilities
Returns anALcdOGCWMSCapabilities
instance that contains the capabilities of the WMS.- Returns:
- an
ALcdOGCWMSService
instance that contains the capabilities of the WMS.
-
isCacheImage
public abstract boolean isCacheImage()Returns whether the images returned by the WMS are cached.- Returns:
- True if the images returned by the WMS are cached.
-
setCacheImage
public abstract void setCacheImage(boolean aCacheImage) Sets whether the images returned by the WMS should be cached. Note that image caching improves the performance but also requires more memory. Implementations of this class are recommended to take into account this property.- Parameters:
aCacheImage
- the new image caching property value.
-
getExceptionHandler
Returns the exception handler of thisALcdWMSProxy
- Returns:
- The exception handler set by
setExceptionHandler
, null if none has been set.
-
setExceptionHandler
Sets the exception handler which is to be used by this proxy. By default, it is set to null.- Parameters:
aExceptionHandler
- A valid exception handler, or null to remove the current exception handler.
-
isInvertXYForEPSG4326
public boolean isInvertXYForEPSG4326()Returns true if the bounding box coordinates should be inverted in case the world reference of the request is EPSG:4326 and the WMS version is 1.3.0. This means that instead of x=lon and y=lat, x=lat and y=lon will be used.- Returns:
- True if coordinates are inverted for EPSG:4326.
-
setInvertXYForEPSG4326
public void setInvertXYForEPSG4326(boolean aInvertXYForEPSG4326) Sets whether the bounding box coordinates should be inverted in case the world reference of the request is EPSG:4326 and the WMS version is 1.3.0. This means that instead of x=lon and y=lat, x=lat and y=lon will be used.For WMS version 1.1.1, the order is defined as x=lon, y=lat. In version 1.3.0 it was decided that the order should be consistent with the order defined in the EPSG:4326 reference which is lat/lon. Consequently, some WMS 1.3.0 servers have changed their interpretation of EPSG:4326 coordinates, while others sticked to the old (WMS 1.1.1) interpretation.
Also note that EPSG:4326 is officially deprecated, so this problem can be avoided if the server supports different reference systems.
By default this is set to false.
- Parameters:
aInvertXYForEPSG4326
- True if coordinates should be inverted for EPSG:4326 and WMS 1.3.0.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
insertIntoCache
Description copied from interface:ILcdCache
Inserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCache
in interfaceILcdCache
- Parameters:
aKey
- the key Object that will be used to identify the Object. The key must therefore be a unique identifier, typically the caller itself:insertIntoCache(this, ...)
.aObject
- the Object to be cached.
-
getCachedObject
Description copied from interface:ILcdCache
Looks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObject
in interfaceILcdCache
- Parameters:
aKey
- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there is no Object corresponding to the given key.
-
removeCachedObject
Description copied from interface:ILcdCache
Looks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObject
in interfaceILcdCache
- Parameters:
aKey
- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there was no Object corresponding to the given key.
-
clearCache
public void clearCache()Description copied from interface:ILcdCache
Clears the cache.- Specified by:
clearCache
in interfaceILcdCache
-
findWMSNamedLayer
Returns the WMS layer from the capabilities for which the unique
layer name
equals the given name.- Parameters:
aNamedLayerName
- The name of the searched WMS named layer- Returns:
- the
ALcdWMSNamedLayer
from the WMS capabilities with nameaNamedLayerName
, ornull
when no such layer can be found.
-
clone
Creates and returns a shallow copy of this object. -
toDataSource
Converts the settings configured in the{@link ALcdWMSProxy WMS proxy}
object into aWMS data source
representation.The following settings are taken into account:
- The server URI.
- The chosen map format.
- The selected layers along with their selected layer style, visibility and participation within feature info requests.
- The transparency of the image background.
- If the coordinates are inverted for EPSG:4326
- The
{@link TLcdSLDStyledLayerDescriptor} styled layer descriptor
.
- Parameters:
aWMSProxy
- the WMS proxy object.- Returns:
- the WMS data source representation.
- Since:
- 2017.0
-
createFeatureInfoInputStream(TLcdWMSGetFeatureInfoContext, TLcdWMSGetFeatureInfoParameters)
instead