Package org.geotools.ows.wms
Class WMSUtils
- Object
-
- WMSUtils
-
public class WMSUtils extends Object
Provides miscellaneous utility methods for use with WMSs.- Author:
- Richard Gould
-
-
Constructor Summary
Constructors Constructor Description WMSUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>
findCommonEPSGs(List layers)
Given a list of type Layer, return all EPSG codes that is supported by all of the layers.static Layer[]
getNamedLayers(WMSCapabilities capabilities)
Utility method to return each layer that has a name.static Set
getQueryableLayers(WMSCapabilities capabilities)
static Set
getSRSs(WMSCapabilities capabilities)
static String
matchEPSG(CoordinateReferenceSystem crs, Set codes)
Given a CRS and a Set of type String consisting of EPSG CRS codes (such as "EPSG:4326"), it will check the transform that exists between each EPSG code's CRS and the given CRS.
-
-
-
Method Detail
-
getNamedLayers
public static Layer[] getNamedLayers(WMSCapabilities capabilities)
Utility method to return each layer that has a name. This method maintains no hierarchy at all.- Returns:
- An array of Layers, each value has a it's name property set or an empty array if there are none. It will return null if there is no capabilities document
-
getQueryableLayers
public static Set getQueryableLayers(WMSCapabilities capabilities)
-
getSRSs
public static Set getSRSs(WMSCapabilities capabilities)
-
findCommonEPSGs
public static Set<String> findCommonEPSGs(List layers)
Given a list of type Layer, return all EPSG codes that is supported by all of the layers. This is an intersection of each layer's SRS set.- Parameters:
layers
- A List of type Layer- Returns:
- a Set of type String, containin EPSG codes, or empty if none found
-
matchEPSG
public static String matchEPSG(CoordinateReferenceSystem crs, Set codes)
Given a CRS and a Set of type String consisting of EPSG CRS codes (such as "EPSG:4326"), it will check the transform that exists between each EPSG code's CRS and the given CRS. If this is the identity transform, meaning the CRS is equivalent to the EPSG code, the used EPSG code will be returned. The first valid EPSG code found is returned, so it is possibly that multiple valid codes exist.If no such identity transform can be found, null will be returned.
If this method is succesful, the result is stored in a cache, which is called in subsequent calls.
- Parameters:
crs
- a CRS that is to be compared to each EPSG code in codescodes
- a Set of type String containing EPSG codes- Returns:
- an EPSG code that correspondes to crs, or null if one can't be found
-
-