org.geotools.data.wms
Class WMSUtils

java.lang.Object
  extended by org.geotools.data.wms.WMSUtils

public class WMSUtils
extends java.lang.Object

Provides miscellaneous utility methods for use with WMSs.

Author:
Richard Gould

Constructor Summary
WMSUtils()
           
 
Method Summary
static java.util.Set findCommonEPSGs(java.util.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 java.util.Set getQueryableLayers(WMSCapabilities capabilities)
           
static java.util.Set getSRSs(WMSCapabilities capabilities)
           
static java.lang.String matchEPSG(org.opengis.referencing.crs.CoordinateReferenceSystem crs, java.util.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WMSUtils

public WMSUtils()
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 java.util.Set getQueryableLayers(WMSCapabilities capabilities)

getSRSs

public static java.util.Set getSRSs(WMSCapabilities capabilities)

findCommonEPSGs

public static java.util.Set findCommonEPSGs(java.util.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 java.lang.String matchEPSG(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                                         java.util.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 codes
codes - a Set of type String containing EPSG codes
Returns:
an EPSG code that correspondes to crs, or null if one can't be found


Copyright © 1996-2010 Geotools. All Rights Reserved.