public class IlvDAFIFReader extends Object implements IlvMapRegionOfInterestIterator, IlvPersistentObject
Constructor and Description |
---|
IlvDAFIFReader()
Creates an empty reader.
|
IlvDAFIFReader(IlvInputStream stream)
Reconstructs a DAFIF reader from parameters read from an input stream.
|
IlvDAFIFReader(String fileName)
Reads a DAFIF directory.
|
IlvDAFIFReader(URL url)
Reads a DAFIF directory.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptTable(IlvDAFIFTableDescription tableDescr)
Indicates if the table should be read by this reader.
|
protected Rectangle2D |
computeBounds()
Computes the bounds of the features selected.
|
IlvMapRegionOfInterestIterator |
deriveReader(IlvFeatureClassInformation vfeatureClass,
IlvGeometryClassFilter vgeometryClass)
Creates a derived reader that only returns features with the selected
feature and geometry classes.
|
void |
dispose()
Releases the resources allocated by the feature iterator
(files, connections, and so on).
|
IlvCoordinateSystem |
getCoordinateSystem()
Returns the spatial reference system that describes the coordinate
system of geometric coordinates of the map features.
|
IlvFeatureRenderer |
getDefaultFeatureRenderer()
Returns a renderer that can be used to translate the map features returned
by this iterator into graphic objects.
|
Rectangle2D |
getLatLonBounds()
Returns or computes the bounds for all the features read.
|
IlvCoordinate |
getLowerRightCorner()
Returns the lower right corner of the rectangle containing all
the map feature of the list, or
null
if the iterator cannot provide this information. |
IlvThreadMonitoringData |
getMonitoringData()
Returns the thread monitoring information.
|
IlvMapFeature |
getNextFeature()
Returns the next map feature of the iterator or
null if the iteration is finished. |
IlvCoordinate |
getUpperLeftCorner()
Returns the upper left corner of the rectangle containing all
the map features of the list, or
null
if the iterator cannot provide this information. |
URL |
getUrl()
Returns the URL set for this reader.
|
boolean |
isGeoreferenced()
Returns
true if the map reader can provide the
source projection of its map features. |
protected void |
readAllAcceptedTables()
Reads all tables in the DAFIF structure that are accepted by the
acceptTable(IlvDAFIFTableDescription) method. |
void |
restart()
Rewinds the iterator for a new use.
|
void |
setFeatureClassFilter(IlvFeatureClassInformation vfeatureClass)
Sets a filter on the DAFIF table.
|
void |
setMonitoringData(IlvThreadMonitoringData monitorData)
Sets the thread monitoring information.
|
void |
setRegionOfInterest(double minX,
double minY,
double maxX,
double maxY)
Sets the region of interest to return features for.
|
void |
setSource(IlvDAFIFDataSource dataSource)
Sets the data source used to filter out tables.
|
void |
setUrl(URL url)
Sets the URL of the DAFIFT directory for this reader.
|
protected void |
updateProgress(int progress)
Updates the progress of the reader, if
monitoringData has been set. |
void |
write(IlvOutputStream stream)
Writes the attributes of the reader.
|
public IlvDAFIFReader()
public IlvDAFIFReader(String fileName) throws IOException
fileName
- The DAFIFT directory to read.IOException
public IlvDAFIFReader(URL url) throws IOException
url
- The URL of the DAFIFT directory.IOException
- if the URL cannot be opened.public IlvDAFIFReader(IlvInputStream stream)
stream
- The stream to read from.public URL getUrl()
public void setUrl(URL url) throws IOException
url
- The URL of the DAFIFT directory.IOException
- if the directory is not accessible or if the URL is malformed.public Rectangle2D getLatLonBounds()
getLatLonBounds
in interface IlvMapRegionOfInterestIterator
protected Rectangle2D computeBounds()
public void setRegionOfInterest(double minX, double minY, double maxX, double maxY)
IlvMapFeatureIterator.getNextFeature()
method should not return any feature which geometry is outside this area.setRegionOfInterest
in interface IlvMapRegionOfInterestIterator
minX
- longitude min in radians.minY
- latitude min in radians.maxX
- longitude max in radians.maxY
- latitude max in radians.IlvMapRegionOfInterestIterator.setRegionOfInterest(double,
double, double, double)
protected void updateProgress(int progress)
monitoringData
has been set.progress
- value between 0 and 100.getMonitoringData()
protected void readAllAcceptedTables() throws IOException
acceptTable(IlvDAFIFTableDescription)
method.IOException,
- if the DAFIF schema cannot be analyzed.IOException
IlvDAFIFTable.readContent(boolean, URL)
protected boolean acceptTable(IlvDAFIFTableDescription tableDescr)
tableDescr
- The description to check.
The default implementation checks:
featureClass
is set, if its code is the table name.
setSource(IlvDAFIFDataSource)
,
setFeatureClassFilter(IlvFeatureClassInformation)
,
IlvFeatureClassInformation.getCode()
,
IlvDefaultTilableDataSource.acceptsCode(Object)
public void restart()
restart
in interface IlvMapReusableFeatureIterator
IlvMapReusableFeatureIterator.restart()
public IlvThreadMonitoringData getMonitoringData()
public void setMonitoringData(IlvThreadMonitoringData monitorData)
monitorData
- The thread monitoring information to set.public IlvMapFeature getNextFeature()
null
if the iteration is finished.
The returned map feature must be considered as volatile and
can be modified by the reader during the next call to its
getNextFeature
function.getNextFeature
in interface IlvMapFeatureIterator
IlvMapFeatureIterator.getNextFeature()
public boolean isGeoreferenced()
true
if the map reader can provide the
source projection of its map features.isGeoreferenced
in interface IlvMapFeatureIterator
IlvMapFeatureIterator.isGeoreferenced()
public IlvCoordinateSystem getCoordinateSystem()
getCoordinateSystem
in interface IlvMapFeatureIterator
null
if the coordinate system is unknown.IlvMapFeatureIterator.getCoordinateSystem()
public IlvCoordinate getUpperLeftCorner()
null
if the iterator cannot provide this information.getUpperLeftCorner
in interface IlvMapFeatureIterator
IlvMapFeatureIterator.getUpperLeftCorner()
public IlvCoordinate getLowerRightCorner()
null
if the iterator cannot provide this information.getLowerRightCorner
in interface IlvMapFeatureIterator
IlvMapFeatureIterator.getLowerRightCorner()
public IlvFeatureRenderer getDefaultFeatureRenderer()
getDefaultFeatureRenderer
in interface IlvMapFeatureIterator
IlvMapFeatureIterator.getDefaultFeatureRenderer()
public void dispose()
dispose
in interface IlvMapFeatureIterator
IlvMapFeatureIterator.dispose()
public IlvMapRegionOfInterestIterator deriveReader(IlvFeatureClassInformation vfeatureClass, IlvGeometryClassFilter vgeometryClass)
vfeatureClass
- The feature class to filter features with.vgeometryClass
- A subclass of IlvMapGeometry
to prevent the mixing of different
types of features on the same layer.public void setSource(IlvDAFIFDataSource dataSource)
dataSource
- The data source used to filter out tables.public void setFeatureClassFilter(IlvFeatureClassInformation vfeatureClass)
vfeatureClass
- The information about the feature to filter.public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.