ilog.views.maps.tiling
Class IlvTilableDataSource

java.lang.Object
  extended by ilog.views.maps.datasource.IlvMapDataSource
      extended by ilog.views.maps.datasource.IlvHierarchicalDataSource
          extended by ilog.views.maps.tiling.IlvTilableDataSource
All Implemented Interfaces:
IlvPersistentObject
Direct Known Subclasses:
IlvSDODataSource, IlvTigerDataSource

public abstract class IlvTilableDataSource
extends IlvHierarchicalDataSource

IlvTilableDataSource is an abstract base class for data sources capable of creating tiled layers.

Since:
JViews 7.5

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.datasource.IlvHierarchicalDataSource
featureIterator, filename, nameMap, styleMap
 
Fields inherited from class ilog.views.maps.datasource.IlvMapDataSource
renderer, usingGeodeticComputation
 
Constructor Summary
IlvTilableDataSource(IlvInputStream stream)
          Constructs an IlvTilableDataSource instance from an IlvInputStream.
IlvTilableDataSource(String filename)
          Constructs a new IlvTilableDataSource from the file specified.
 
Method Summary
protected  void createGenericTiles(IlvTileController tileController, IlvCoordinateTransformation tr)
          This method creates the free tiles in the tiled layer.
protected abstract  IlvMapRegionOfInterestIterator createTiledIterator(IlvMapLayer layer)
          Creates an iterator that will iterate through the map features for a specific area of interest.
protected abstract  void createTiledLayers()
          Creates all the possible map layers that may be needed when load on demand occurs in the data source insertion layer.
protected  int getColumnCount()
          Returns the number of tile columns in this IlvTilableDataSource object.
protected  double getLatMax()
          Returns the maximum latitude.
protected  double getLatMin()
          Returns the minimum latitude.
protected  double getLonMax()
          Returns the maximum longitude.
protected  double getLonMin()
          Returns the minimum longitude.
protected  int getRowCount()
          Returns the number of tile rows in this IlvTilableDataSource object.
 boolean isMultiThreaded()
          Tests whether the tiled layer created by this data source will use multithreading to load the tiles.
 void reset()
          Resets the data source.
 void setAreaOfinterest(double lonMin, double latMin, double lonMax, double latMax)
          Sets the area outside of which data will not be fetched.
 void setMultiThreaded(boolean t)
          Sets whether the tiled layer created by this data source will use multithreading to load the tiles.
 void setTilingParameters(boolean useTiling, int rows, int columns)
          Sets the tiling parameters for this data source.
protected  void setupTiledLoaders()
          Sets up the tile loader for all child map layers of the insertion layer.
 void start()
          Starts this data source.
protected  boolean useTiling()
          Tests whether tiling is used.
 void write(IlvOutputStream stream)
          Writes this IlvVMAPDataSource to an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.datasource.IlvHierarchicalDataSource
addCriterionFilter, addLayer, createFeatureRenderer, createInsertionLayer, getCriterionFilters, getFeatureIterator, getFeatureRenderer, getFeatureRenderer, getKey, getMapLayer, getStyle, isAcceptNullValues, readInfo, removeAllCriterionFilters, removeCriterionFilter, setAcceptNullValues, setupLayer
 
Methods inherited from class ilog.views.maps.datasource.IlvMapDataSource
addDataSourceListener, callListeners, getBackupDataSources, getCoordinateSystem, getDescription, getInsertionLayer, getManager, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isSaveBackupDataSources, isSourceDataAvailable, 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

IlvTilableDataSource

public IlvTilableDataSource(IlvInputStream stream)
                     throws IlvReadFileException
Constructs an IlvTilableDataSource instance from an IlvInputStream.

Parameters:
stream - The input stream to read from.
Throws:
IlvReadFileException - if there is an error reading from stream.

IlvTilableDataSource

public IlvTilableDataSource(String filename)
                     throws MalformedURLException
Constructs a new IlvTilableDataSource from the file specified.

Parameters:
filename - The filename pointing to the data.
Throws:
MalformedURLException - if filename is incorrectly configured.
Method Detail

reset

public void reset()
Resets the data source.

Call this method to 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 - The minimum longitude for this area of interest.
latMin - The minimum latitude for this area of interest.
lonMax - The maximum longitude for this area of interest.
latMax - The maximum latitude for this area of interest.

setTilingParameters

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

Parameters:
useTiling - Set to true to enable the load on demand mechanism this data source. Set to false for all data to be loaded when the start method is called.
rows - The number of rows of tiles. This parameter is used only when useTiling is set to true.
columns - The number of columns of tiles. This parameter is used only when useTiling is set to true.
See Also:
start()

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 - if there is a problem writing to stream.

createGenericTiles

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

Parameters:
tileController - The IlvTileController that controls the tiled layer for this data source.
tr - The coordinate transformation between the source coordinate system and the map, that is, the destination, coordinate system.

getColumnCount

protected int getColumnCount()
Returns the number of tile columns in this IlvTilableDataSource object.

Returns:
Returns The tile column count.

getLatMax

protected double getLatMax()
Returns the maximum latitude.

Returns:
The latitude max.

getLatMin

protected double getLatMin()
Returns the minimum latitude.

Returns:
The latitude min.

getLonMax

protected double getLonMax()
Returns the maximum longitude.

Returns:
The longitude max.

getLonMin

protected double getLonMin()
Returns the minimum longitude.

Returns:
The longitude min.

getRowCount

protected int getRowCount()
Returns the number of tile rows in this IlvTilableDataSource object.

Returns:
The tile row count.

useTiling

protected boolean useTiling()
Tests whether tiling is used.

Returns:
If tiling is used, true is returned.

createTiledIterator

protected abstract IlvMapRegionOfInterestIterator createTiledIterator(IlvMapLayer layer)
                                                               throws IOException
Creates an iterator that will iterate through the map features for a specific area of interest.

Parameters:
layer - The layer to create objects for.
Returns:
The feature iterator.
Throws:
IOException

createTiledLayers

protected abstract void createTiledLayers()
Creates all the possible map layers that may be needed when load on demand occurs in the data source insertion layer.


start

public void start()
           throws Exception
Starts this data source. When the data source is started, the following happens:

Overrides:
start in class IlvHierarchicalDataSource
Throws:
Exception - if there is a problem in one of the processes listed.

setupTiledLoaders

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


isMultiThreaded

public boolean isMultiThreaded()
Tests whether the tiled layer created by this data source will use multithreading to load the tiles.

Returns:
If multithreading is used, true is returned.
Since:
JViews 7.5
See Also:
setMultiThreaded(boolean)

setMultiThreaded

public void setMultiThreaded(boolean t)
Sets whether the tiled layer created by this data source will use multithreading to load the tiles.

Note: this method must be called before the data source is started.

Parameters:
t - Set to true to enable multithreading.
Since:
JViews 7.5
See Also:
start()


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