public class IlvRasterASRPReader extends IlvRasterAbstractReader
IlvRasterASRPReader r = new IlvRasterASRPReader(); r.addMap(fileName);
Modifier and Type | Class and Description |
---|---|
static class |
IlvRasterASRPReader.ASRPProjection
Projection encapsulating an
IlvARCProjectionFactory.IlvAbstractARCProjection to ensure that in the
non-polar regions longitude coordinates smaller than the longitude
origin will have a negative projected value. |
protected static class |
IlvRasterASRPReader.FieldPosition
Class to store tag field position information.
|
protected static class |
IlvRasterASRPReader.SubFieldPosition
Class to store subfield position information.
|
protected static class |
IlvRasterASRPReader.TagInfo
Class to store and a list of
IlvRasterASRPReader.SubFieldPosition
position information. |
Modifier and Type | Field and Description |
---|---|
protected String |
imgFileName
Raster information about the raster currently loading.
|
protected IlvMathTransform |
internalTransformation
Transformation from x/y to lat/lon data
|
protected int[] |
tileIndexes
List of tile indexes used when the ASRP image uses zero pixel tiles.
|
needReload
Constructor and Description |
---|
IlvRasterASRPReader()
Default constructor.
|
IlvRasterASRPReader(IlvInputStream stream)
Creates a new
IlvRasterASRPReader from previously saved information in the input stream. |
Modifier and Type | Method and Description |
---|---|
boolean |
addMap(String baseName)
Starts the reading of files and adds a new ASRP image.
|
boolean |
addMap(URL url)
Starts the reading of files and adds a new ASRP image.
|
IlvCoordinateSystem |
getCoordinateSystem()
Returns a projected ARC coordinate system.
|
protected double |
getDoubleField(byte[] data,
IlvRasterASRPReader.SubFieldPosition fpos)
Utility method to read and convert raw bytes to double subfield data.
|
IlvMathTransform |
getInternalTransformation(int imageIndex)
Return the projection associated with the zone of the file to load.
|
protected int |
getIntField(byte[] data,
IlvRasterASRPReader.SubFieldPosition fpos)
Utility method to read and convert raw bytes to int subfield data.
|
IlvFeatureAttributeProperty |
getProperties(int imageIndex)
Returns the feature properties to be associated with the image.
|
protected String |
getStringField(byte[] data,
IlvRasterASRPReader.SubFieldPosition fpos)
Utility method to read and convert raw bytes to string subfield data.
|
static boolean |
isASRPFile(File file)
Checks if a file could be an ASRP GEN File by checking its content.
|
protected static FileInputStream |
openStream(String fileName)
Opens a file input stream trying for extension in upper and lowercase.
|
protected static InputStream |
openStream(URL url)
<
Opens a file input stream trying for extension in upper and lowercase.
|
protected IlvRasterASRPReader.TagInfo |
parseFields(String descr)
Decodes the list of subfields from a string - returns the filled
TagInfo . |
protected void |
parseTags(Hashtable<String,IlvRasterASRPReader.FieldPosition> t,
String descr,
int nbCharLength,
int nbCharPos,
int nbCharName)
Decodes the list of fields in a record from a string - adds them to the hashtable.
|
protected byte[] |
readData(DataInput stream,
Hashtable<String,IlvRasterASRPReader.FieldPosition> tags)
Utility method to read raw data bytes from an ASRP record - also fills
tags with data. |
protected void |
readGEN(String file,
IlvRasterProperties loadingRaster)
Reads the GEN file of a ASRP image.
|
protected void |
readGEN(URL url,
IlvRasterProperties loadingRaster)
Reads the GEN file of a ASRP image.
|
protected void |
readIMG(String fileName,
IlvRasterProperties loadingRaster,
byte[] rasterData)
Reads the IMG file of an ASRP image.
|
protected void |
readIMG(URL url,
IlvRasterProperties loadingRaster,
byte[] rasterData)
Reads the IMG file of an ASRP image.
|
protected void |
readQAL(String file,
IlvRasterProperties loadingRaster,
HashMap<String,String> digestProperties)
Reads the QAL file of a ASRP image.
|
protected void |
readQAL(URL url,
IlvRasterProperties loadingRaster,
HashMap<String,String> digestProperties)
Reads the QAL file of a ASRP image.
|
void |
reload(IlvThreadMonitoringData monitorInfo)
Given the state of the reader (number of images read, coverage zone,...), the purpose of this method
is to recreate all images from the original source.
|
protected void |
storeDigestProperties(Hashtable<String,IlvRasterASRPReader.TagInfo> fields,
Hashtable<String,IlvRasterASRPReader.FieldPosition> tags,
byte[] data,
HashMap<String,String> digestProperties)
Method that analyses QAL file data in order to store the DIGEST meta data.
|
void |
write(IlvOutputStream stream)
Writes the attributes of a persistent object.
|
addRaster, computeGisImageBounds, computeLimits, createRasterTileLoader, dispose, getDefaultFeatureRenderer, getDefaultMaximumIntervalsForDeterminingImageLocation, getImageBounds, getImageCount, getInverseTransformation, getLowerRightCorner, getLowerRightCorner, getMaximumIntervalsForDeterminingImageLocation, getNextFeature, getRasterMappedBuffer, getRasterProperties, getTileLoader, getTileLoader, getTileLoaders, getTransformation, getUpperLeftCorner, getUpperLeftCorner, isForceImageLoadingWhenSaving, isGeoreferenced, isHighQualityRendering, isNeedReload, removeRaster, restart, setDefaultMaximumIntervalsForDeterminingImageLocation, setForceImageLoadingWhenSaving, setHighQualityRendering, setMaximumIntervalsForDeterminingImageLocation, setTransformation
protected transient IlvMathTransform internalTransformation
protected int[] tileIndexes
protected String imgFileName
public IlvRasterASRPReader()
public IlvRasterASRPReader(IlvInputStream stream) throws IlvReadFileException
IlvRasterASRPReader
from previously saved information in the input stream.stream
- Stream being read.IlvReadFileException
public IlvMathTransform getInternalTransformation(int imageIndex)
getInternalTransformation
in class IlvRasterAbstractReader
imageIndex
- The index of the image in the collection of image returned by
the IlvRasterAbstractReader.getTileLoader(int)
method.IlvNonPolarARCProjection
for zones 1 to 8 and 10 to 17,
a IlvNorthPolarARCProjection
for the zone 11 or an
IlvSouthPolarARCProjection
for zone 18.public boolean addMap(String baseName) throws IOException
baseName
- The base name path of the file.true
if the ASRP file was successfully loaded.IOException
public boolean addMap(URL url) throws IOException
url
- The URL of the file.true
if the ASRP file was successfully loaded.IOException
public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
write
in class IlvRasterAbstractReader
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public void reload(IlvThreadMonitoringData monitorInfo)
IlvRasterProperties
of the reader as they
might not be saved when the theme only is saved.reload
in class IlvRasterAbstractReader
monitorInfo
- Used to update task progress.IlvRasterAbstractReader.reload(ilog.views.maps.raster.datasource.IlvThreadMonitoringData)
protected double getDoubleField(byte[] data, IlvRasterASRPReader.SubFieldPosition fpos)
data
- The data to analyze.fpos
- The position of the subfield.protected int getIntField(byte[] data, IlvRasterASRPReader.SubFieldPosition fpos)
data
- The data to analyze.fpos
- The position of the subfield.protected String getStringField(byte[] data, IlvRasterASRPReader.SubFieldPosition fpos)
data
- The data to analyze.fpos
- The position of the subfield.protected IlvRasterASRPReader.TagInfo parseFields(String descr)
TagInfo
.descr
- The field description.protected void storeDigestProperties(Hashtable<String,IlvRasterASRPReader.TagInfo> fields, Hashtable<String,IlvRasterASRPReader.FieldPosition> tags, byte[] data, HashMap<String,String> digestProperties)
fields
- TagInfo per name Hashtable. It will be filled by fields found in the digest datatags
- FieldPosition per name Hashtable. This mst be provideddata
- data read from QAL file.digestProperties
- string value per complete name Hashtable filled by this method.protected void parseTags(Hashtable<String,IlvRasterASRPReader.FieldPosition> t, String descr, int nbCharLength, int nbCharPos, int nbCharName)
t
- The table containing the parsed tags.descr
- The description.nbCharLength
- Number of characters for the length part.nbCharPos
- Number of characters for the position part.nbCharName
- Number of characters for the name part.protected byte[] readData(DataInput stream, Hashtable<String,IlvRasterASRPReader.FieldPosition> tags) throws IOException
tags
with data.stream
- The input stream to read.tags
- The table in which to put the tags read by this utility.IOException
- when an error is encountered when reading the stream.protected void readGEN(String file, IlvRasterProperties loadingRaster) throws IOException
file
- The path to the GEN file.loadingRaster
- Information about the current image.IOException
protected void readGEN(URL url, IlvRasterProperties loadingRaster) throws IOException
url
- The url to the GEN file.loadingRaster
- Information about the current image.IOException
protected static FileInputStream openStream(String fileName) throws FileNotFoundException
fileName
- The file name to open.FileNotFoundException
protected static InputStream openStream(URL url) throws MalformedURLException, IOException
url
- the url to open.IOException
MalformedURLException
FileNotFoundException
protected void readIMG(String fileName, IlvRasterProperties loadingRaster, byte[] rasterData) throws IOException
fileName
- The path to the GEN file.loadingRaster
- Information about the current image.rasterData
- The raster data.IOException
protected void readIMG(URL url, IlvRasterProperties loadingRaster, byte[] rasterData) throws IOException
url
- The url to the GEN file.loadingRaster
- Information about the current image.rasterData
- The raster data.IOException
protected void readQAL(String file, IlvRasterProperties loadingRaster, HashMap<String,String> digestProperties) throws IOException
file
- The path to the QAL file.loadingRaster
- Information about the current image.digestProperties
- name/value pair hashtable for metadata found in the QAL file.IOException
protected void readQAL(URL url, IlvRasterProperties loadingRaster, HashMap<String,String> digestProperties) throws IOException
url
- The url to the QAL file.loadingRaster
- Information about the current image.digestProperties
- name/value pair hashtable for metadata found in the QAL file.IOException
public IlvCoordinateSystem getCoordinateSystem()
null
if the coordinate system is unknown.IlvMapFeatureIterator.getCoordinateSystem()
public IlvFeatureAttributeProperty getProperties(int imageIndex)
getProperties
in class IlvRasterAbstractReader
imageIndex
- The index of the image.IlvRasterAbstractReader.getProperties(int)
public static boolean isASRPFile(File file)
file
- file to check.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.