ilog.views.maps.datasource
Class IlvShapeDataSource

java.lang.Object
  extended by ilog.views.maps.datasource.IlvMapDataSource
      extended by ilog.views.maps.datasource.IlvShapeDataSource
All Implemented Interfaces:
IlvPersistentObject
Direct Known Subclasses:
IlvTiledShapeDataSource

public class IlvShapeDataSource
extends IlvMapDataSource

A data source specialized on reading ESRI/Shape files.

Since:
JViews 7.5

Field Summary
 
Fields inherited from class ilog.views.maps.datasource.IlvMapDataSource
renderer, usingGeodeticComputation
 
Constructor Summary
IlvShapeDataSource(IlvInputStream stream)
          Reads an IlvShapeDataSource from an IlvInputStream.
IlvShapeDataSource(String filename)
          Constructs a IlvShapeDataSource from a shape file name.
IlvShapeDataSource(String filename, boolean attachAttributes)
          Constructs a Shape data source given the name of the shape file and indicating if the data source should attach attributes to graphic objects.
IlvShapeDataSource(String shpFilename, String dbfFilename, String shxFilename, String idxFilename)
          Constructs a Shape data source giving the name of the shape file, the name of the dbf file and the name of the shx file.
IlvShapeDataSource(URL url)
          Constructs a IlvShapeDataSource from a shape file URL, not attaching attributes.
IlvShapeDataSource(URL url, boolean attachAttributes)
          Constructs a IlvShapeDataSource from a shape file URL.
IlvShapeDataSource(URL shpURL, URL dbfURL, URL shxURL, URL idxURL)
          Constructs a Shape data source giving the name of the shape file, the name of the dbf file and the name of the shx file.
 
Method Summary
protected  IlvMapStyle createStyle(IlvMapFeature feature)
          Creates a map style for the specified feature.
 String getDbfFilename()
          Retrieves the dbf file name.
 URL getDbfURL()
          Retrieves the DBF file URL.
 IlvMapReusableFeatureIterator getFeatureIterator()
          Retrieves the feature iterator used by this data source
 IlvFeatureRenderer getFeatureRenderer()
          Retrieves the feature renderer used by this data source.
 String getIdxFilename()
          Retrieves the spatial index file name.
 URL getIdxURL()
          Retrieves the idx file URL.
 URL getShapeURL()
          Retrieves the shape file URL.
 String getShpFilename()
          Retrieves the shape file name.
 String getShxFilename()
          Retrieves the shx file name.
 URL getShxURL()
          Retrieves the shx file URL.
protected  boolean isSourceDataAvailable()
          Tells if the source data is available.
 void reset()
          Resets this data source for further use.
 void setIdxFilename(String idxFilename)
          Sets the name of the spatial index file
 void setShapeURL(URL url)
          Sets the shape URL value.
 void setShpFilename(String filename)
          Sets the shape file name.
 void write(IlvOutputStream stream)
          Writes an IlvShapeDataSource into an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.datasource.IlvMapDataSource
addDataSourceListener, callListeners, createInsertionLayer, getBackupDataSources, getCoordinateSystem, getDescription, getInsertionLayer, getManager, getMapLayer, getName, getNode, getValidExtentions, hasInsertionLayer, initBackupDataSource, initInsertionLayer, isAttachingAttributes, isSaveBackupDataSources, isUsingGeodeticComputation, mapIntersects, removeDataSourceListener, setAttachingAttributes, setCoordinateSystem, setDescription, setFeatureRenderer, setForceUsingBackupDataSource, setInsertionLayer, setManager, setName, setSaveBackupDataSources, setValidExtentions, start, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvShapeDataSource

public IlvShapeDataSource(IlvInputStream stream)
                   throws IlvReadFileException,
                          MalformedURLException
Reads an IlvShapeDataSource from an IlvInputStream.

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

IlvShapeDataSource

public IlvShapeDataSource(String filename)
Constructs a IlvShapeDataSource from a shape file name.

Parameters:
filename - The name of a shape file.

IlvShapeDataSource

public IlvShapeDataSource(URL url,
                          boolean attachAttributes)
Constructs a IlvShapeDataSource from a shape file URL.

Parameters:
url - The URL to read from.
attachAttributes - Set to true if attaching attributes to graphic objects.
Since:
JViews 7.5

IlvShapeDataSource

public IlvShapeDataSource(URL url)
Constructs a IlvShapeDataSource from a shape file URL, not attaching attributes.

Parameters:
url - The URL to read from.
Since:
JViews 7.5

IlvShapeDataSource

public IlvShapeDataSource(String filename,
                          boolean attachAttributes)
Constructs a Shape data source given the name of the shape file and indicating if the data source should attach attributes to graphic objects.

Parameters:
filename - The shape file name.
attachAttributes - true if the data source should attach false otherwise.

IlvShapeDataSource

public IlvShapeDataSource(String shpFilename,
                          String dbfFilename,
                          String shxFilename,
                          String idxFilename)
Constructs a Shape data source giving the name of the shape file, the name of the dbf file and the name of the shx file.

Parameters:
shpFilename - The shape file name.
dbfFilename - The dbf file name.
shxFilename - The shx file name.
idxFilename - The index file name.

IlvShapeDataSource

public IlvShapeDataSource(URL shpURL,
                          URL dbfURL,
                          URL shxURL,
                          URL idxURL)
Constructs a Shape data source giving the name of the shape file, the name of the dbf file and the name of the shx file.

Parameters:
shpURL - The shape file URL.
dbfURL - The dbf file URL.
shxURL - The shx file URL.
idxURL - The index file URL.
Since:
JViews 7.5
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes an IlvShapeDataSource into an IlvOutputStream.

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

getShpFilename

public String getShpFilename()
Retrieves the shape file name.

Returns:
The shape file name.

setShpFilename

public void setShpFilename(String filename)
Sets the shape file name. The corresponding dbf, shx an idx file names are reconstructed.

Parameters:
filename - The new shape file name.

setIdxFilename

public void setIdxFilename(String idxFilename)
Sets the name of the spatial index file

Parameters:
idxFilename - The idxFilename to set.

getDbfFilename

public String getDbfFilename()
Retrieves the dbf file name.

Returns:
The dbf file name.

getShxFilename

public String getShxFilename()
Retrieves the shx file name.

Returns:
The shx file name.

getShapeURL

public URL getShapeURL()
Retrieves the shape file URL.

Returns:
The shape file URL or null.
Since:
JViews 7.5

setShapeURL

public void setShapeURL(URL url)
Sets the shape URL value.

Parameters:
url - The URL pointing to the shape resource.
Since:
JViews 8.0

getIdxURL

public URL getIdxURL()
Retrieves the idx file URL.

Returns:
The idx file URL or null.
Since:
JViews 7.5

getDbfURL

public URL getDbfURL()
Retrieves the DBF file URL.

Returns:
The DBF file URL or null.
Since:
JViews 7.5

getShxURL

public URL getShxURL()
Retrieves the shx file URL.

Returns:
The shx file URL or null.
Since:
JViews 7.5

getIdxFilename

public String getIdxFilename()
Retrieves the spatial index file name.

Returns:
The idx file name.

getFeatureIterator

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

Specified by:
getFeatureIterator in class IlvMapDataSource
Returns:
The IlvMapReusableFeatureIterator

getFeatureRenderer

public IlvFeatureRenderer getFeatureRenderer()
                                      throws Exception
Retrieves the feature renderer used by this data source.

Overrides:
getFeatureRenderer in class IlvMapDataSource
Returns:
The IlvFeatureRenderer.
Throws:
Exception

reset

public void reset()
Resets this data source for further use.

Overrides:
reset in class IlvMapDataSource

createStyle

protected IlvMapStyle createStyle(IlvMapFeature feature)
Creates a map style for the specified feature. This is used in the feature iterator when the map layer attached to the data source has no predefined style set.

Parameters:
feature - the IlvMapFeature.
Returns:
a IlvMapStyle for the feature
Since:
JViews 7.5

isSourceDataAvailable

protected boolean isSourceDataAvailable()
Tells if the source data is available.

Overrides:
isSourceDataAvailable in class IlvMapDataSource
Returns:
true if the source data is available, false otherwise.
Since:
JViews 8.0


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