ilog.views.maps.format.wms
Class IlvWMSDataSource

java.lang.Object
  extended by ilog.views.maps.datasource.IlvMapDataSource
      extended by ilog.views.maps.datasource.IlvHierarchicalDataSource
          extended by ilog.views.maps.format.IlvDefaultTilableDataSource
              extended by ilog.views.maps.format.wms.IlvWMSDataSource
All Implemented Interfaces:
IlvPersistentObject

public class IlvWMSDataSource
extends IlvDefaultTilableDataSource

A data source for reading a URL that points to an OpenGIS-compliant map server.

Since:
JViews 8.0

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
IlvHierarchicalDataSource.CriterionFilter, IlvHierarchicalDataSource.SingleAttributeFilter
 
Field Summary
 
Fields inherited from class ilog.views.maps.format.IlvDefaultTilableDataSource
GeometryClassInformation
 
Fields inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
featureIterator, filename, nameMap, styleMap
 
Fields inherited from class ilog.views.maps.datasource.IlvMapDataSource
renderer, usingGeodeticComputation
 
Constructor Summary
IlvWMSDataSource(IlvInputStream stream)
          Creates a new IlvWMSDataSource.
IlvWMSDataSource(IlvWMSReader reader)
          Constructs an IlvWMSDataSource from the specified reader.
IlvWMSDataSource(URL url)
          Constructs an IlvWMSDataSource from the specified URL.
 
Method Summary
 boolean acceptsCode(Object codeValue)
          Indicates if the current data source accepts the specified code value.
protected  IlvDefaultFeatureFilter createDefaultFilter()
          Returns a filter based on WMS layer names.
protected  IlvMapReusableFeatureIterator createFeatureIterator(String fileName)
          Method used in IlvDefaultTilableDataSource.IlvDefaultTilableDataSource(String) constructor to build the data source reader.
protected  IlvMapReusableFeatureIterator createFeatureIterator(URL url)
          Method used in IlvDefaultTilableDataSource.IlvDefaultTilableDataSource(URL) constructor to build the data source reader.
protected  IlvMapRegionOfInterestIterator createTiledIterator(IlvFeatureClassInformation featureValue, IlvGeometryClassFilter geometryClass)
          Creates an iterator that iterates through the map features for a specific area of interest.
 double[] getBBox()
          Retrieves the bounding box set by the setBBox method.
 IlvMapReusableFeatureIterator getFeatureIterator()
          Retrieves the feature iterator used by this data source.
 String getImageFormat()
          Retrieves the image format to be used in the the request to the WMS.
 float getImageSize()
          Retrieves the image size.
 IlvMapLayer getInsertionLayer()
          Retrieves the insertion layer.
 String[] getLayers()
          Retrieves the list of layers that are read by the data source.
 IlvWMSReader getReader()
          Retrieves the feature iterator as an IlvWMSReader .
 String getRS()
          Retrieves the reference system.
 boolean getTransparency()
          Indicates if the data source is generating transparent images.
 String getVersion()
          Retrieves the version information that is issued in the request to the WMS.
protected  void initFeatureList()
          Specific initialization done when data source is created.
 boolean isFlatteningLayers()
          Indicates if the data source produces only one IlvMapLayer for all the requested layers or one IlvMapLayer per requested layer.
 boolean isPackingLayers()
          Indicates if the data source is trying to pack successive layers under the same parent.
protected  boolean isSourceDataAvailable()
          Checks whether the source data this IlvMapDataSource is based on is available (file, database connection, url...). A .ivl, JViews Maps file keeps references to the original sources the map was built from. It can happen that these sources are not available when opening the map, for example, when the map is transferred to another machine. This method checks that availability. In the case where these sources are not available, all operations that need them are performed from the data embedded in the map, but there is a risk of loosing information (when reprojecting for example). This method should be overridden by subclasses.
 String makeLayerName(String name, IlvGeometryClassFilter d)
          Creates a layer name from a feature name and a geometry class.
 void setBBox(double[] bbox)
          Sets the bounding box used by the feature iterator.
 void setFlatteningLayers(boolean flatten)
          Indicates to the data source if the layers should be flattened or not.
 void setImageFormat(String f)
          Sets the image format that is used in the request to the WMS.
 void setImageSize(float imageSize)
          Sets the image size (between 0 and 1).
 void setLayers(String[] layers)
          Sets the list of layers to be read by the data source.
 void setPackingLayers(boolean p)
          Indicates if the data source should try to pack the successive layers under the same parent.
 void setRS(String rs)
          Sets the reference system.
 void setTransparency(boolean transparency)
          Indicates if this data source should generate transparent images.
 void setVersion(String version)
          Sets the version information to be issued in the request to the WMS.
 void start()
          Starts this data source.
 void write(IlvOutputStream stream)
          Writes this IlvVMAPDataSource to an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.format.IlvDefaultTilableDataSource
addLayer, createGenericTiles, createTiledLayers, getColumnCount, getFeatureFilterPropertyName, getFeatureName, getGeometryClassFilters, getGeometryClassInformation, getLatMax, getLatMin, getLayerOrder, getLonMax, getLonMin, getMonitoringData, getRowCount, getURL, isMultiThreaded, isUsingTiling, readInfo, reset, setAcceptedCodeList, setAreaOfinterest, setLayerOrder, setMonitoringData, setMultiThreaded, setTilingParameters, setupLayer, setupTiledLoaders, setURL
 
Methods inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
addCriterionFilter, createFeatureRenderer, createInsertionLayer, getCriterionFilters, getFeatureRenderer, getFeatureRenderer, getKey, getMapLayer, getStyle, isAcceptNullValues, removeAllCriterionFilters, removeCriterionFilter, setAcceptNullValues
 
Methods inherited from class ilog.views.maps.datasource.IlvMapDataSource
addDataSourceListener, callListeners, getBackupDataSources, getCoordinateSystem, getDescription, getManager, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isSaveBackupDataSources, isUsingGeodeticComputation, mapIntersects, removeDataSourceListener, setAttachingAttributes, setCoordinateSystem, setDescription, setFeatureRenderer, setForceUsingBackupDataSource, setInsertionLayer, setManager, setName, setSaveBackupDataSources, setValidExtentions, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvWMSDataSource

public IlvWMSDataSource(IlvInputStream stream)
                 throws IlvReadFileException
Creates a new IlvWMSDataSource.

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException

IlvWMSDataSource

public IlvWMSDataSource(IlvWMSReader reader)
                 throws IOException
Constructs an IlvWMSDataSource from the specified reader.

Parameters:
reader - An IlvWMSReader.
Throws:
IOException

IlvWMSDataSource

public IlvWMSDataSource(URL url)
                 throws IOException
Constructs an IlvWMSDataSource from the specified URL.

Parameters:
url - The URL of the server.
Throws:
IOException
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this IlvVMAPDataSource to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvDefaultTilableDataSource
Parameters:
stream - The stream to write to.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.
See Also:
IlvMapDataSource.write(ilog.views.io.IlvOutputStream)

createFeatureIterator

protected IlvMapReusableFeatureIterator createFeatureIterator(URL url)
Method used in IlvDefaultTilableDataSource.IlvDefaultTilableDataSource(URL) constructor to build the data source reader. For example:
  protected void createFeatureIterator(URL urlName)
  {
    return new IlvS57Reader(urlName);
  }
   

Specified by:
createFeatureIterator in class IlvDefaultTilableDataSource
Parameters:
url - file parameter.
Returns:
the data source reader.

getFeatureIterator

public IlvMapReusableFeatureIterator getFeatureIterator()
Retrieves the feature iterator used by this data source.

Overrides:
getFeatureIterator in class IlvHierarchicalDataSource
Returns:
null.

getReader

public IlvWMSReader getReader()
Retrieves the feature iterator as an IlvWMSReader .

Returns:
The IlvWMSReader used by this data source.

getInsertionLayer

public IlvMapLayer getInsertionLayer()
Retrieves the insertion layer.

Overrides:
getInsertionLayer in class IlvMapDataSource
Returns:
The insertion layer.

isPackingLayers

public boolean isPackingLayers()
Indicates if the data source is trying to pack successive layers under the same parent.

Returns:
Returns true, if layers are packed, otherwise false.

setPackingLayers

public void setPackingLayers(boolean p)
Indicates if the data source should try to pack the successive layers under the same parent.

Parameters:
p - Set to true to pack layers, otherwise false.

start

public void start()
           throws Exception
Starts this data source. The rendering process is initiated. The map features are read from the reader, graphic objects are rendered and inserted into the manager.

Overrides:
start in class IlvDefaultTilableDataSource
Throws:
Exception

createTiledIterator

protected IlvMapRegionOfInterestIterator createTiledIterator(IlvFeatureClassInformation featureValue,
                                                             IlvGeometryClassFilter geometryClass)
Creates an iterator that iterates through the map features for a specific area of interest.

Specified by:
createTiledIterator in class IlvDefaultTilableDataSource
Parameters:
featureValue - The feature value to filter features with.
geometryClass - The subclass of IlvMapGeometry that prevents the mixing of different types of features in the same layer.
Returns:
The feature iterator.

createDefaultFilter

protected IlvDefaultFeatureFilter createDefaultFilter()
Returns a filter based on WMS layer names.

Overrides:
createDefaultFilter in class IlvDefaultTilableDataSource
Returns:
The default feature filter that will be used to separate layers for this data source.
See Also:
IlvDefaultTilableDataSource.createDefaultFilter()

acceptsCode

public boolean acceptsCode(Object codeValue)
Indicates if the current data source accepts the specified code value.

Overrides:
acceptsCode in class IlvDefaultTilableDataSource
Returns:
true if the value is registered.

initFeatureList

protected void initFeatureList()
Specific initialization done when data source is created. It should be used to retrieve the possible feature codes that the data source can manage.

Specified by:
initFeatureList in class IlvDefaultTilableDataSource
See Also:
  protected void initFeatureList()
  {
    readInfo("featureDescription.txt"); //$NON-NLS-1$
  }
   

createFeatureIterator

protected IlvMapReusableFeatureIterator createFeatureIterator(String fileName)
Method used in IlvDefaultTilableDataSource.IlvDefaultTilableDataSource(String) constructor to build the data source reader. For example:
  protected void createFeatureIterator(String fileName)
  {
    return new IlvS57Reader(fileName);
  }
   

Specified by:
createFeatureIterator in class IlvDefaultTilableDataSource
Parameters:
fileName - file parameter.
Returns:
the data source reader.

setLayers

public void setLayers(String[] layers)
Sets the list of layers to be read by the data source.

Parameters:
layers - The list of layers to be read by the data source.

getLayers

public String[] getLayers()
Retrieves the list of layers that are read by the data source.

Returns:
The list of layers that are read by the data source.

isFlatteningLayers

public boolean isFlatteningLayers()
Indicates if the data source produces only one IlvMapLayer for all the requested layers or one IlvMapLayer per requested layer.

Returns:
Returns true if only one layer is produced or false if multilayers are produced.

setImageFormat

public void setImageFormat(String f)
Sets the image format that is used in the request to the WMS.

Parameters:
f - The image format that is used in the the request to the WMS.

getImageFormat

public String getImageFormat()
Retrieves the image format to be used in the the request to the WMS.

Returns:
The image format to be used in the the request to the WMS.

setFlatteningLayers

public void setFlatteningLayers(boolean flatten)
Indicates to the data source if the layers should be flattened or not.

Parameters:
flatten - Set to true to flatten a layer, otherwise false.

setTransparency

public void setTransparency(boolean transparency)
Indicates if this data source should generate transparent images.

Parameters:
transparency - Set to true to generate transparent images, otherwise false.

getTransparency

public boolean getTransparency()
Indicates if the data source is generating transparent images.

Returns:
Returns true if this data source generates transparent images, otherwise false.

getRS

public String getRS()
Retrieves the reference system.

Returns:
The reference system to be issued by the request to the WMS.

setRS

public void setRS(String rs)
Sets the reference system. If set to a non null value, the value is used in the request instead of trying to determine it automatically.

Parameters:
rs - The reference system.

getVersion

public String getVersion()
Retrieves the version information that is issued in the request to the WMS.

Returns:
The version information that is issued in the request to the WMS.

setVersion

public void setVersion(String version)
Sets the version information to be issued in the request to the WMS.

Parameters:
version - The version information to be issued in the request to the WMS.

setImageSize

public void setImageSize(float imageSize)
Sets the image size (between 0 and 1).

Parameters:
imageSize - Sets the image size.

getImageSize

public float getImageSize()
Retrieves the image size.

Returns:
The image size.

makeLayerName

public String makeLayerName(String name,
                            IlvGeometryClassFilter d)
Creates a layer name from a feature name and a geometry class.

Overrides:
makeLayerName in class IlvDefaultTilableDataSource
Parameters:
name - feature name.
d - geometry class.
Returns:
a string to use as a layer name.

isSourceDataAvailable

protected boolean isSourceDataAvailable()
Checks whether the source data this IlvMapDataSource is based on is available (file, database connection, url...). A .ivl, JViews Maps file keeps references to the original sources the map was built from. It can happen that these sources are not available when opening the map, for example, when the map is transferred to another machine. This method checks that availability. In the case where these sources are not available, all operations that need them are performed from the data embedded in the map, but there is a risk of loosing information (when reprojecting for example). This method should be overridden by subclasses.

Overrides:
isSourceDataAvailable in class IlvDefaultTilableDataSource
Returns:
Returns true, if the original source data is available.

setBBox

public void setBBox(double[] bbox)
Sets the bounding box used by the feature iterator. Set null to allow the feature iterator to compute its bounding box from the capabilities.

Parameters:
bbox - The bounding box.

getBBox

public double[] getBBox()
Retrieves the bounding box set by the setBBox method.

Returns:
the bounding box set by the setBBox method.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.