ilog.views.maps.format
Class IlvDefaultTilableDataSource

java.lang.Object
  extended by ilog.views.maps.datasource.IlvMapDataSource
      extended by ilog.views.maps.datasource.IlvHierarchicalDataSource
          extended by ilog.views.maps.format.IlvDefaultTilableDataSource
All Implemented Interfaces:
IlvPersistentObject
Direct Known Subclasses:
IlvDXFDataSource, IlvKMLDataSource, IlvSVGDataSource, IlvWMSDataSource

public abstract class IlvDefaultTilableDataSource
extends IlvHierarchicalDataSource

An abstract base class for data sources capable of creating a hierarchical set of tiled layers.

Since:
JViews 8.0

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
IlvHierarchicalDataSource.CriterionFilter, IlvHierarchicalDataSource.SingleAttributeFilter
 
Field Summary
static IlvGeometryClassFilter[] GeometryClassInformation
          List of geometries managed by tilable datasource.
 
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
IlvDefaultTilableDataSource(IlvInputStream stream)
          Constructs a IlvDefaultTilableDataSource from the specified IlvInputStream
IlvDefaultTilableDataSource(String filename)
          Constructs a IlvDefaultTilableDataSource from the specified file name.
IlvDefaultTilableDataSource(URL url)
          Constructs a IlvDefaultTilableDataSource from the specified url.
 
Method Summary
 boolean acceptsCode(Object codeValue)
          Indicates if the current data source accepts the specified code value.
protected  void addLayer(IlvMapLayer parent, IlvMapLayer layer)
          Adds a specified IlvMapLayer in the specified parent layer.
protected  IlvDefaultFeatureFilter createDefaultFilter()
          Creates, at construction time, the filter that will be used to separate features into layers.
protected abstract  IlvMapReusableFeatureIterator createFeatureIterator(String fileName)
          Method used in IlvDefaultTilableDataSource(String) constructor to build the data source reader.
protected abstract  IlvMapReusableFeatureIterator createFeatureIterator(URL urlName)
          Method used in IlvDefaultTilableDataSource(URL) constructor to build the data source reader.
protected  void createGenericTiles(IlvTileController tileController, IlvCoordinateTransformation tr)
          This method creates the free tiles in the tiled layer
protected abstract  IlvMapRegionOfInterestIterator createTiledIterator(IlvFeatureClassInformation featureClass, IlvGeometryClassFilter geometryClass)
          Should create the specific IlvMapRegionOfInterestIterator to be used for this data source.
protected  void createTiledLayers()
          Creates the set of IlvMapLayer to be used for tile management.
 int getColumnCount()
          Returns the tile column Count.
protected  String getFeatureFilterPropertyName()
          Deprecated. since JViews 8.1, this method is deprecated and should be replaced by an implementation of createDefaultFilter()
 Object getFeatureName(Object codeValue)
          Returns the feature name for the feature code passed or null.
protected  IlvGeometryClassFilter[] getGeometryClassFilters()
          By default, returns GeometryClassInformation
 IlvGeometryClassFilter getGeometryClassInformation(IlvMapFeature feature)
          Returns the geometry class information for the selected feature.
 double getLatMax()
          Returns the latitude Max.
 double getLatMin()
          Returns the latitude Min.
protected  Integer getLayerOrder(IlvMapLayer layer)
          A utility method that retrieves the map layer order.
 double getLonMax()
          Returns the longitude Max.
 double getLonMin()
          Returns the longitude Min.
 IlvThreadMonitoringData getMonitoringData()
          Returns the monitorData.
 int getRowCount()
          Returns the tile row Count.
 URL getURL()
          Retrieves the URL given at construction time.
protected abstract  void initFeatureList()
          Specific initialization done when data source is created.
 boolean isMultiThreaded()
          Returns whether the tiled layer created by this data source uses multithreading to load tiles
protected  boolean isSourceDataAvailable()
          Checks whether the source data this IlvMapDataSource is based on is available (file, database connection, url...).
 boolean isUsingTiling()
          Returns whether tiling is used.
 String makeLayerName(String name, IlvGeometryClassFilter d)
          Creates a layer name from a feature name and a geometry class.
 void readInfo(String info)
          Creates the table of attributes values from a text file description.
 void reset()
          Resets the data source.
 void setAcceptedCodeList(String[] codes)
          Sets the list of accepted object codes
 void setAreaOfinterest(double lonMin, double latMin, double lonMax, double latMax)
          Sets the area outside of which data will not be fetched.
protected  void setLayerOrder(IlvMapLayer layer, Integer order)
          A utility method that stores the map layer order.
 void setMonitoringData(IlvThreadMonitoringData monitorData)
          Sets the monitor data.
 void setMultiThreaded(boolean t)
          Indicates whether the tiled layer created by this data source will use multithreading to load tiles.
 void setTilingParameters(boolean useTiling, int rows, int columns)
          Sets tiling parameters for this data source.
protected  void setupLayer(IlvMapLayer layer, IlvMapFeature feature)
          This method has been overridden so the preferred order in the layer is also stored.
protected  void setupTiledLoaders()
          Sets up tile loader for all map layers children of the insertion layer.
 void setURL(URL url)
          Sets the URL.
 void start()
          Starts this data source.
 void write(IlvOutputStream stream)
          Writes this IlvVMAPDataSource to an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
addCriterionFilter, createFeatureRenderer, createInsertionLayer, getCriterionFilters, getFeatureIterator, getFeatureRenderer, getFeatureRenderer, getKey, getMapLayer, getStyle, isAcceptNullValues, removeAllCriterionFilters, removeCriterionFilter, setAcceptNullValues
 
Methods inherited from class ilog.views.maps.datasource.IlvMapDataSource
addDataSourceListener, callListeners, getBackupDataSources, getCoordinateSystem, getDescription, getInsertionLayer, 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
 

Field Detail

GeometryClassInformation

public static IlvGeometryClassFilter[] GeometryClassInformation
List of geometries managed by tilable datasource.

Constructor Detail

IlvDefaultTilableDataSource

public IlvDefaultTilableDataSource(IlvInputStream stream)
                            throws IlvReadFileException
Constructs a IlvDefaultTilableDataSource from the specified IlvInputStream

Parameters:
stream - the input stream to read from
Throws:
IlvReadFileException

IlvDefaultTilableDataSource

public IlvDefaultTilableDataSource(String filename)
                            throws MalformedURLException
Constructs a IlvDefaultTilableDataSource from the specified file name.

Parameters:
filename - The name of the file to read.
Throws:
MalformedURLException - if the path cannot be parsed as a URL

IlvDefaultTilableDataSource

public IlvDefaultTilableDataSource(URL url)
                            throws IOException
Constructs a IlvDefaultTilableDataSource from the specified url.

Parameters:
url - The URL to read from.
Throws:
IOException
Method Detail

acceptsCode

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

Parameters:
codeValue -
Returns:
true if the value is registered.

reset

public void reset()
Resets the data source. Prepare this data source for reloading.

Overrides:
reset in class IlvHierarchicalDataSource
See Also:
IlvMapDataSource.reset()

setAreaOfinterest

public void setAreaOfinterest(double lonMin,
                              double latMin,
                              double lonMax,
                              double latMax)
Sets the area outside of which data will not be fetched.

Parameters:
lonMin - Minimum longitude of the area of interest.
latMin - Minimum latitude of the area of interest.
lonMax - Maximum longitude of the area of interest.
latMax - Maximum latitude of the area of interest.

setTilingParameters

public void setTilingParameters(boolean useTiling,
                                int rows,
                                int columns)
Sets tiling parameters for this data source.

Parameters:
useTiling - If true, this data source will use the load on demand mechanism for loading data. If false, all the data will be loaded when the start method is called.
rows - Number of rows of tiles (only when useTiling is true);
columns - Number of columns of tiles (only when useTiling is true);

write

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

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvHierarchicalDataSource
Parameters:
stream - The stream to write to.
Throws:
IOException

createGenericTiles

protected void createGenericTiles(IlvTileController tileController,
                                  IlvCoordinateTransformation tr)
This method creates the free tiles in the tiled layer

Parameters:
tileController - the IlvTileController this data source's tiled layer
tr - the coordinate transformation between source coordinate system and map (destination) coordinate system.

getColumnCount

public int getColumnCount()
Returns the tile column Count.

Returns:
Returns the tile column Count.

getLatMax

public double getLatMax()
Returns the latitude Max.

Returns:
Returns the latitude Max.

getLatMin

public double getLatMin()
Returns the latitude Min.

Returns:
Returns the latitude Min.

getLonMax

public double getLonMax()
Returns the longitude Max.

Returns:
Returns the longitude Max.

getLonMin

public double getLonMin()
Returns the longitude Min.

Returns:
Returns the longitude Min.

getRowCount

public int getRowCount()
Returns the tile row Count.

Returns:
Returns the tile row Count.

isUsingTiling

public boolean isUsingTiling()
Returns whether tiling is used.

Returns:
Returns whether tiling is used.

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 IlvHierarchicalDataSource
Throws:
Exception

setupTiledLoaders

protected void setupTiledLoaders()
Sets up tile loader for all map layers children of the insertion layer.


isMultiThreaded

public boolean isMultiThreaded()
Returns whether the tiled layer created by this data source uses multithreading to load tiles

Returns:
boolean, true if multi threaded, false if not.

setMultiThreaded

public void setMultiThreaded(boolean t)
Indicates whether the tiled layer created by this data source will use multithreading to load tiles. This method must be called before the data source is started.

Parameters:
t - boolean, true if multi threaded, false if not.

getGeometryClassInformation

public IlvGeometryClassFilter getGeometryClassInformation(IlvMapFeature feature)
Returns the geometry class information for the selected feature.

Parameters:
feature - feature to search for a geometry class.
Returns:
the information(mainly name) of this geometry.

getGeometryClassFilters

protected IlvGeometryClassFilter[] getGeometryClassFilters()
By default, returns GeometryClassInformation

Returns:
the list of possible geometry classes that can be loaded.
Since:
JViews 8.1

readInfo

public void readInfo(String info)
Creates the table of attributes values from a text file description.

Overrides:
readInfo in class IlvHierarchicalDataSource
Parameters:
info - the description file.
See Also:
IlvHierarchicalDataSource.readInfo(java.lang.String)

makeLayerName

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

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

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.

See Also:
setAcceptedCodeList(String[]), getGeometryClassFilters()

setupLayer

protected void setupLayer(IlvMapLayer layer,
                          IlvMapFeature feature)
This method has been overridden so the preferred order in the layer is also stored.

Overrides:
setupLayer in class IlvHierarchicalDataSource
Parameters:
layer - The layer.
feature - The feature.
Since:
JViews 8.1
See Also:
IlvHierarchicalDataSource.setupLayer(ilog.views.maps.beans.IlvMapLayer, ilog.views.maps.IlvMapFeature)

getFeatureName

public Object getFeatureName(Object codeValue)
Returns the feature name for the feature code passed or null.

Parameters:
codeValue - value of the feature property.
Returns:
the feature name or null.

setAcceptedCodeList

public void setAcceptedCodeList(String[] codes)
Sets the list of accepted object codes

Parameters:
codes - an array of accepted object codes (decimal values)

createDefaultFilter

protected IlvDefaultFeatureFilter createDefaultFilter()
Creates, at construction time, the filter that will be used to separate features into layers. For example, this method can create an IlvDefaultFeatureFilter instance and pass the property used to split features.

Returns:
The default feature filter that will be used to separate layers for this data source.
Since:
JViews 8.1

createTiledIterator

protected abstract IlvMapRegionOfInterestIterator createTiledIterator(IlvFeatureClassInformation featureClass,
                                                                      IlvGeometryClassFilter geometryClass)
Should create the specific IlvMapRegionOfInterestIterator to be used for this data source. For example:
   protected IlvMapRegionOfInterestIterator createTiledIterator(IlvFeatureClassInformation featureValue,IlvGeometryClassFilter geometryClass)  {
      // retrieve a default iterator
      IlvS57Reader initial = (IlvS57Reader) getFeatureIterator();
      // and create a new one which filters the specific geomerty and feature classes.
      return initial.deriveReader(featureValue,geometryClass);
   }
   

Parameters:
featureClass - information on which feature code should be filtered.
geometryClass - information on which geometry class is acceptable.
Returns:
the iterator set up with the specified parameters.

initFeatureList

protected abstract 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.

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

createFeatureIterator

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

Parameters:
fileName - file parameter.
Returns:
the data source reader.
Throws:
IOException

createFeatureIterator

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

Parameters:
urlName - file parameter.
Returns:
the data source reader.
Throws:
IOException

getFeatureFilterPropertyName

protected String getFeatureFilterPropertyName()
Deprecated. since JViews 8.1, this method is deprecated and should be replaced by an implementation of createDefaultFilter()

This method should return the feature property used to filter features out. It will be used to set a new IlvDefaultFeatureFilter on the data source at construction time.

Returns:
Returns the property name to use.

getMonitoringData

public IlvThreadMonitoringData getMonitoringData()
Returns the monitorData.

Returns:
Returns the monitorData.

setMonitoringData

public void setMonitoringData(IlvThreadMonitoringData monitorData)
Sets the monitor data.

Parameters:
monitorData - The monitorData to set.

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 IlvMapDataSource
Returns:
Returns true, if the original source data is available.

getURL

public URL getURL()
Retrieves the URL given at construction time.

Returns:
the URL given at construction time.

setURL

public void setURL(URL url)
Sets the URL.

Parameters:
url - The URL to set.

addLayer

protected void addLayer(IlvMapLayer parent,
                        IlvMapLayer layer)
Adds a specified IlvMapLayer in the specified parent layer.

Overrides:
addLayer in class IlvHierarchicalDataSource
Parameters:
parent - the parent layer.
layer - the IlvMapLayer to add

setLayerOrder

protected void setLayerOrder(IlvMapLayer layer,
                             Integer order)
A utility method that stores the map layer order. This default implementation stores the map layer order in the manager layer properties.

Parameters:
layer - The layer to change
order - The order indicator.
Since:
JViews 8.1

getLayerOrder

protected Integer getLayerOrder(IlvMapLayer layer)
A utility method that retrieves the map layer order.

Parameters:
layer - The map layer.
Returns:
The order or null if the order has not has been set.
Since:
JViews 8.1


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