com.ontimize.util.gis.server.dataproviders
Class SitgaDataProvider

java.lang.Object
  extended by com.ontimize.util.gis.server.dataproviders.SitgaDataProvider
All Implemented Interfaces:
IWMSDataProvider, IDataProvider

public class SitgaDataProvider
extends java.lang.Object
implements IDataProvider, IWMSDataProvider

Raster data provider. It uses WMS (Web Map Service) servers as geographic data source.

Xml definition parameters:

Name Description Required
wmsURL WMS server url Yes
wmsLayer WMS server layers list used on data request (separated by ",") Yes
scales Set of graphic scales used by the data provider. These values will
be expressed in metric units by pixel.
Yes
wmsSRS Layer spatial reference system expressed in EPSG code format. If this parameter is not indicated, default SRS will be used. No

Sample definition code:

<DataProvider
     class="com.ontimize.util.gis.server.dataproviders.WMSDataProvider"
     type="raster">
     <Attribute name="scales"
     value="1.0;2.0;4.0;8.0;16.0;32.0;64.0;100.0;350.0;1000.0" />
     <Attribute name="wmsURL" value="http://www.idee.es/wms/PNOA/PNOA" />
     <Attribute name="wmsSRS" value="EPSG:23030" />
     <Attribute name="wmsLayer" value="pnoa" />
</DataProvider>


Field Summary
protected  java.lang.String entityName
           
protected  java.lang.String exceptions
           
protected  org.geotools.styling.StyleFactory factory
           
protected  boolean firstTime
           
protected  org.geotools.data.ows.Layer[] layers
           
protected  boolean transparent
           
protected  org.geotools.data.wms.WebMapServer wms
           
protected static java.lang.String WMS_LAYER_NAME
           
protected static java.lang.String WMS_SRS
           
protected static java.lang.String WMS_URL
           
protected  java.lang.String[] wmsLayersNames
           
protected  java.lang.String wmsLayersString
           
protected  java.lang.String wmsSRS
           
protected  java.lang.String wmsURL
           
 
Fields inherited from interface com.ontimize.util.gis.server.dataproviders.IWMSDataProvider
WMS_DESCRIPTION, WMS_KEYWORDS, WMS_LAYERS, WMS_TITLE, WMS_TRANSPARENT_OPTION
 
Constructor Summary
SitgaDataProvider()
           
SitgaDataProvider(java.util.Hashtable parameters)
           
 
Method Summary
protected  java.awt.image.BufferedImage createBuffer(int width, int height)
           
 java.util.Hashtable<java.lang.String,java.lang.Object> getServerInfo()
          Get the related server info
 void initProvider(java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
           
protected  java.net.URL parseURLWMSRequest(java.util.Hashtable<java.lang.String,java.lang.Object> appliedFilters)
           
 java.lang.Object query(java.lang.Object keysValues, java.lang.Object attributes, int sessionId)
          This method must implement a standard query operation returning the set of data that matches the conditions specified by the keysValues parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WMS_URL

protected static final java.lang.String WMS_URL
See Also:
Constant Field Values

WMS_LAYER_NAME

protected static final java.lang.String WMS_LAYER_NAME
See Also:
Constant Field Values

WMS_SRS

protected static final java.lang.String WMS_SRS
See Also:
Constant Field Values

exceptions

protected final java.lang.String exceptions
See Also:
Constant Field Values

wmsURL

protected java.lang.String wmsURL

wmsSRS

protected java.lang.String wmsSRS

wmsLayersNames

protected java.lang.String[] wmsLayersNames

wmsLayersString

protected java.lang.String wmsLayersString

transparent

protected boolean transparent

firstTime

protected boolean firstTime

wms

protected org.geotools.data.wms.WebMapServer wms

layers

protected org.geotools.data.ows.Layer[] layers

factory

protected org.geotools.styling.StyleFactory factory

entityName

protected java.lang.String entityName
Constructor Detail

SitgaDataProvider

public SitgaDataProvider()

SitgaDataProvider

public SitgaDataProvider(java.util.Hashtable parameters)
Method Detail

initProvider

public void initProvider(java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
Specified by:
initProvider in interface IDataProvider

query

public java.lang.Object query(java.lang.Object keysValues,
                              java.lang.Object attributes,
                              int sessionId)
                       throws java.lang.Exception
Description copied from interface: IDataProvider
This method must implement a standard query operation returning the set of data that matches the conditions specified by the keysValues parameter. The attributes defines which attributes (or columns if data is obtained from a database) must be recovered, and keysValues specifies which set of records must be recovered.

Specified by:
query in interface IDataProvider
Parameters:
keysValues - Identifiers for the data
attributes - Data attributes to query
sessionId - Session Id for this user
Returns:
Requested data
Throws:
java.lang.Exception

parseURLWMSRequest

protected java.net.URL parseURLWMSRequest(java.util.Hashtable<java.lang.String,java.lang.Object> appliedFilters)

createBuffer

protected java.awt.image.BufferedImage createBuffer(int width,
                                                    int height)

getServerInfo

public java.util.Hashtable<java.lang.String,java.lang.Object> getServerInfo()
Description copied from interface: IWMSDataProvider
Get the related server info

Specified by:
getServerInfo in interface IWMSDataProvider
Returns:
Server info