public class IlvWMSDataSource extends IlvDefaultTilableDataSource
IlvHierarchicalDataSource.CriterionFilter, IlvHierarchicalDataSource.SingleAttributeFilter
GeometryClassInformation
featureIterator, filename, nameMap, styleMap
renderer, usingGeodeticComputation
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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 the
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.
|
protected void |
createTiledLayers()
Creates the set of
IlvMapLayer to be used for tile management. |
double[] |
getBBox()
Retrieves the bounding box set by the
setBBox method. |
IlvMapReusableFeatureIterator |
getFeatureIterator()
Retrieves the feature iterator used by this data source.
|
protected IlvGeometryClassFilter[] |
getGeometryClassFilters()
By default, returns
IlvDefaultTilableDataSource.GeometryClassInformation |
String |
getImageFormat()
Retrieves the image format to be used in the the request to the WMS.
|
double |
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...). |
String |
makeLayerName(String name,
IlvGeometryClassFilter d)
Creates a layer name from a feature name and a geometry class.
|
void |
setAreaOfinterest(double lonMin,
double latMin,
double lonMax,
double latMax)
Sets the area outside of which data will not be fetched.
|
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(double 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 . |
addLayer, createGenericTiles, getColumnCount, getFeatureFilterPropertyName, getFeatureName, getGeometryClassInformation, getLatMax, getLatMin, getLayerOrder, getLonMax, getLonMin, getMonitoringData, getRowCount, getURL, isMultiThreaded, isUsingTiling, readInfo, reset, setAcceptedCodeList, setLayerOrder, setMonitoringData, setMultiThreaded, setTilingParameters, setupLayer, setupTiledLoaders, setURL
addCriterionFilter, createFeatureRenderer, createInsertionLayer, createStyle, getCriterionFilters, getFeatureRenderer, getFeatureRenderer, getKey, getMapLayer, getStyle, isAcceptNullValues, removeAllCriterionFilters, removeCriterionFilter, setAcceptNullValues
addDataSourceListener, callListeners, getBackupDataSources, getCoordinateSystem, getDescription, getManager, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isGrapherMode, isSaveBackupDataSources, isUsingBackupDataSource, isUsingGeodeticComputation, mapIntersects, removeDataSourceListener, setAttachingAttributes, setCoordinateSystem, setDescription, setFeatureRenderer, setForceUsingBackupDataSource, setGrapherMode, setInsertionLayer, setManager, setName, setSaveBackupDataSources, setValidExtentions, toString
public IlvWMSDataSource(IlvInputStream stream) throws IlvReadFileException
IlvWMSDataSource
.stream
- The stream to read from.IlvReadFileException
public IlvWMSDataSource(IlvWMSReader reader) throws IOException
IlvWMSDataSource
from the specified reader.reader
- An IlvWMSReader
.IOException
public IlvWMSDataSource(URL url) throws IOException
IlvWMSDataSource
from the specified URL.url
- The URL of the server.IOException
public void write(IlvOutputStream stream) throws IOException
IlvVMAPDataSource
to an
IlvOutputStream
.write
in interface IlvPersistentObject
write
in class IlvDefaultTilableDataSource
stream
- The stream to write to.IOException
- thrown when an exception occurs during
the write operation for this object.IlvMapDataSource.write(ilog.views.io.IlvOutputStream)
protected IlvMapReusableFeatureIterator createFeatureIterator(URL url)
IlvDefaultTilableDataSource.IlvDefaultTilableDataSource(URL)
constructor to build the data source reader.
For example:protected void createFeatureIterator(URL urlName) { return new IlvS57Reader(urlName); }
createFeatureIterator
in class IlvDefaultTilableDataSource
url
- The file parameter.public IlvMapReusableFeatureIterator getFeatureIterator()
getFeatureIterator
in class IlvDefaultTilableDataSource
null>/code>.
-
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
.
-
getGeometryClassFilters
protected IlvGeometryClassFilter[] getGeometryClassFilters()
By default, returns IlvDefaultTilableDataSource.GeometryClassInformation
- Overrides:
getGeometryClassFilters
in class IlvDefaultTilableDataSource
- Returns:
- the list of possible geometry classes that can be loaded.
- See Also:
IlvDefaultTilableDataSource.getGeometryClassFilters()
-
createTiledLayers
protected void createTiledLayers()
Creates the set of IlvMapLayer
to be used for tile management.
The default implementation creates one layer for each (selected feature code,geometry class) pair.
- Overrides:
createTiledLayers
in class IlvDefaultTilableDataSource
- Since:
- JViews 8.7
- See Also:
IlvDefaultTilableDataSource.setAcceptedCodeList(String[])
,
IlvDefaultTilableDataSource.getGeometryClassFilters()
-
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
- Parameters:
codeValue
- The code to look for.
- 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
- The 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(double imageSize)
Sets the image size (between 0 and 1).
- Parameters:
imageSize
- Sets the image size.
-
getImageSize
public double 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
- The feature name.
d
- The 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.
-
setAreaOfinterest
public void setAreaOfinterest(double lonMin,
double latMin,
double lonMax,
double latMax)
Sets the area outside of which data will not be fetched.
- Overrides:
setAreaOfinterest
in class IlvDefaultTilableDataSource
- Parameters:
lonMin
- The minimum longitude of the area of interest.
latMin
- The minimum latitude of the area of interest.
lonMax
- The maximum longitude of the area of interest.
latMax
- The maximum latitude of the area of interest.
-
getBBox
public double[] getBBox()
Retrieves the bounding box set by the setBBox
method.
- Returns:
- the bounding box set by the
setBBox
method.
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.