ilog.views.maps.format.svg
Class IlvMapSVGReader

java.lang.Object
  extended by ilog.views.maps.format.svg.IlvMapSVGReader
All Implemented Interfaces:
IlvPersistentObject, IlvMapFeatureIterator, IlvMapReusableFeatureIterator, IlvMapRegionOfInterestIterator

public class IlvMapSVGReader
extends Object
implements IlvMapRegionOfInterestIterator, IlvPersistentObject

IlvMapSVGReader is a reader for SVG files.

The following code example shows how to use this class:

 ...
 IlvMapSVGReader r = new IlvMapSVGReader(fileName);
 ..
 

Since:
JViews 8.1

Constructor Summary
IlvMapSVGReader(IlvInputStream stream)
          Reconstructs an SVG reader from the parameters read from an input stream.
IlvMapSVGReader(String fileName)
          Creates a new SVG reader.
IlvMapSVGReader(URL url)
          Creates a new SVG reader.
 
Method Summary
 IlvMapRegionOfInterestIterator deriveReader(IlvFeatureClassInformation vfeatureClass, IlvGeometryClassFilter vgeometryClass)
          Builds a customized reader to read only the features set by the filters.
 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 the latitude/longitude bounds for the list of all geometries or null if such is not available.
 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.
 boolean isGeoreferenced()
          Returns true if the map reader can provide the source projection of its map features.
 void restart()
          Rewinds the iterator for a new use.
 void setCoordinateSystem(IlvCoordinateSystem coordsys)
          Sets the coordinate system for this reader.
 void setDestinationBounds(Rectangle2D dBounds)
          Sets the affine transformation to apply to SVG graphical objects and to georeference them.
 void setFeatureClassFilter(IlvFeatureClassInformation vfeatureClass)
          Sets a filter on the SVG folder.
 void setGeometryClassFilter(IlvGeometryClassFilter vgeometryClass)
          Sets a filter on the geometry class.
 void setInternalTransformation(IlvMathTransform transformation)
          Sets the mathematical transformation to apply to SVG graphical objects so they can be georeferenced.
 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 write(IlvOutputStream stream)
          Writes this IlvMapSVGReader instance to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapSVGReader

public IlvMapSVGReader(URL url)
Creates a new SVG reader.

Parameters:
url - A URL pointing to the SVG file to be read. These file can be in .kml or .kmz format.

IlvMapSVGReader

public IlvMapSVGReader(String fileName)
                throws MalformedURLException
Creates a new SVG reader.

Parameters:
fileName - The path of the SVG file to be read. This files can be in .kml or .kmz format.
Throws:
MalformedURLException - if fileName is an unrecognized file type.

IlvMapSVGReader

public IlvMapSVGReader(IlvInputStream stream)
Reconstructs an SVG reader from the parameters read from an input stream.

Parameters:
stream - The stream to read from.
Method Detail

getMonitoringData

public IlvThreadMonitoringData getMonitoringData()
Returns the thread monitoring information.

Returns:
The thread monitoring information.

setMonitoringData

public void setMonitoringData(IlvThreadMonitoringData monitorData)
Sets the thread monitoring information.

Parameters:
monitorData - The thread monitoring information to set.

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this IlvMapSVGReader instance to a stream.

Specified by:
write in interface IlvPersistentObject
Parameters:
stream - The output stream to write to.
Throws:
IOException - if there is a problem writing to stream.
See Also:
IlvPersistentObject.write(ilog.views.io.IlvOutputStream)

restart

public void restart()
Rewinds the iterator for a new use.

Specified by:
restart in interface IlvMapReusableFeatureIterator
See Also:
IlvMapReusableFeatureIterator.restart()

getNextFeature

public IlvMapFeature getNextFeature()
                             throws IOException
Returns the next map feature of the iterator or 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.

Specified by:
getNextFeature in interface IlvMapFeatureIterator
Throws:
IOException
See Also:
IlvMapFeatureIterator.getNextFeature()

setCoordinateSystem

public void setCoordinateSystem(IlvCoordinateSystem coordsys)
Sets the coordinate system for this reader.

Parameters:
coordsys - The coordinate system to set for this reader.

isGeoreferenced

public boolean isGeoreferenced()
Returns true if the map reader can provide the source projection of its map features.

Specified by:
isGeoreferenced in interface IlvMapFeatureIterator
See Also:
IlvMapFeatureIterator.isGeoreferenced()

getCoordinateSystem

public IlvCoordinateSystem getCoordinateSystem()
Returns the spatial reference system that describes the coordinate system of geometric coordinates of the map features.

Specified by:
getCoordinateSystem in interface IlvMapFeatureIterator
Returns:
The coordinate system, or null if the coordinate system is unknown.
See Also:
IlvMapFeatureIterator.getCoordinateSystem()

getUpperLeftCorner

public 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.

Specified by:
getUpperLeftCorner in interface IlvMapFeatureIterator
See Also:
IlvMapFeatureIterator.getUpperLeftCorner()

getLowerRightCorner

public 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.

Specified by:
getLowerRightCorner in interface IlvMapFeatureIterator
See Also:
IlvMapFeatureIterator.getLowerRightCorner()

getDefaultFeatureRenderer

public IlvFeatureRenderer getDefaultFeatureRenderer()
Returns a renderer that can be used to translate the map features returned by this iterator into graphic objects. Feature iterators that store some rendering information in the attributes of the map features, such as color, text font, line thickness and so on, can return a specific renderer which is able to take these attributes into account during the rendering process.

Specified by:
getDefaultFeatureRenderer in interface IlvMapFeatureIterator
See Also:
IlvMapFeatureIterator.getDefaultFeatureRenderer()

dispose

public void dispose()
Releases the resources allocated by the feature iterator (files, connections, and so on).

Specified by:
dispose in interface IlvMapFeatureIterator
See Also:
IlvMapFeatureIterator.dispose()

deriveReader

public IlvMapRegionOfInterestIterator deriveReader(IlvFeatureClassInformation vfeatureClass,
                                                   IlvGeometryClassFilter vgeometryClass)
Builds a customized reader to read only the features set by the filters.

Parameters:
vfeatureClass - The feature type filter.
vgeometryClass - The geometry filter.
Returns:
A newly derived SVG reader.

setFeatureClassFilter

public void setFeatureClassFilter(IlvFeatureClassInformation vfeatureClass)
Sets a filter on the SVG folder.

Parameters:
vfeatureClass - Information about the feature to filter.

setGeometryClassFilter

public void setGeometryClassFilter(IlvGeometryClassFilter vgeometryClass)
Sets a filter on the geometry class.

Parameters:
vgeometryClass - Information about the accepted geometries.

setRegionOfInterest

public void setRegionOfInterest(double minX,
                                double minY,
                                double maxX,
                                double maxY)
Sets the region of interest to return features for. After this method is called, the IlvMapFeatureIterator.getNextFeature() method should not return any feature which geometry is outside this area.

Specified by:
setRegionOfInterest in interface IlvMapRegionOfInterestIterator
Parameters:
minX - longitude min in radians.
minY - latitude min in radians.
maxX - longitude max in radians.
maxY - latitude max in radians.
See Also:
IlvMapRegionOfInterestIterator.setRegionOfInterest(double, double, double, double)

getLatLonBounds

public Rectangle2D getLatLonBounds()
Returns the latitude/longitude bounds for the list of all geometries or null if such is not available.

Specified by:
getLatLonBounds in interface IlvMapRegionOfInterestIterator
Returns:
a rectangle enclosing all features.
See Also:
IlvMapRegionOfInterestIterator.getLatLonBounds()

setInternalTransformation

public void setInternalTransformation(IlvMathTransform transformation)
Sets the mathematical transformation to apply to SVG graphical objects so they can be georeferenced.

Parameters:
transformation - The transformation to be used.

setDestinationBounds

public void setDestinationBounds(Rectangle2D dBounds)
Sets the affine transformation to apply to SVG graphical objects and to georeference them.

Parameters:
dBounds - The bounds in radians into which the reader should fit SVG objects.


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