@LcdService(service=ILcdModelReferenceDecoder.class, priority=20000) public class TLcdEPSGModelReferenceDecoder extends java.lang.Object implements ILcdModelReferenceDecoder, ILcdInputStreamFactoryCapable
ILcdModelReferenceDecoder
decodes model references
based on .epsg files corresponding to the given source files.
A .epsg file contains a single decimal EPSG code, formatted as "n"
or "EPSG:n", that defines a georeference. Any lines starting with
a hash sign "#" are treated as comments and ignored.
The decoder first tries to find a .epsg file by replacing the extension of
the source file by .epsg
.
If this fails, it tries to find a directory.epsg
file next to
the source file.
If this fails, it tries to find a DIRECTORY.EPSG
file next to
the source file.
If this fails, it throws an IOException
.
See TLcdEPSGReferenceParser
for a list of supported epsg codes.
TLcdEPSGReferenceParser
,
TLcdCompositeModelReferenceDecoder
Constructor and Description |
---|
TLcdEPSGModelReferenceDecoder() |
Modifier and Type | Method and Description |
---|---|
ILcdModelReference |
decodeModelReference(java.lang.String aSource)
Tries to locate the model reference file by
replacing the suffix by '.epsg', or adding the suffix '.epsg' if there was no suffix
looking for a 'directory.epsg' in the same directory,
looking for a 'DIRECTORY.EPSG' in the same directory.
If no such file is found, an IOException is thrown.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used for accessing .epsg files.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that will be used for accessing .epsg files.
|
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the factory responsible to generate input streams
from which the model references will be decoded.getInputStreamFactory()
public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
setInputStreamFactory(ILcdInputStreamFactory)
public ILcdModelReference decodeModelReference(java.lang.String aSource) throws java.io.IOException
decodeModelReference
in interface ILcdModelReferenceDecoder
aSource
- the location of the data file for which to locate and decode a reference file.ILcdModelReference
decoded from one of the files as described above.java.io.IOException
- if none of the files as described above exists, or when the file found
cannot be decoded as a properties file.