Package com.luciad.format.s57
Class TLcdS57ModelEncoder
java.lang.Object
com.luciad.format.s57.TLcdS57ModelEncoder
- All Implemented Interfaces:
ILcdOutputStreamFactoryCapable
,ILcdModelEncoder
,Serializable
@LcdService(service=ILcdModelEncoder.class,
priority=20000)
public class TLcdS57ModelEncoder
extends Object
implements ILcdModelEncoder, ILcdOutputStreamFactoryCapable
This model encoder encodes S-57 domain data into S-57 data files. Instances can be created via
TLcdS57ProductConfiguration.createModelEncoder()
Output files
File | Description |
---|---|
*.000 | S-57 cell files |
Supported file transfer protocols
- This model encoder supports all transfer protocols that are supported by the
outputStreamFactory
of this encoder.
Supported models for saving
- This model encoder can save all models decoded by the
TLcdS57ModelDecoder
.
Supported models for exporting
- This model encoder only supports exporting of models already defined in the S-57 domain
model (
com.luciad.format.s57
.
Supported model references
- This model encoder uses the geodetic reference
information which is configured on the
TLcdS57ModelDescriptor
(seeTLcdS57ModelDescriptor.setHorizontalGeodeticDatum(int)
and related methods).
Sample code
TLcdS57ProductConfiguration productConfiguration =
TLcdS57ProductConfiguration.newInstance( ELcdS57ProductType.ENC );
ILcdModelEncoder encoder = productConfiguration.createModelEncoder();
encoder.export(model, "LC000000.000");
Thread safety
- The encoding of models is thread-safe, as long as no properties are changed during the encoding.
Supported versions and specifications
- S-57 Edition 3.1, November 2000
Known limitations
- The S-57 update mechanism is not supported for encoding; the encoder can only create .000 files.
- Encoding of relationships is not supported yet.
- Since:
- 2013.0
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this encoder can export the specified model to the specified destination.boolean
Returns whether this model encoder can save the specified model to the location it originally came from.void
Exports the specified model to the specified destination.Returns a short, displayable name for the format thisILcdModelEncoder
encodes to.Returns the output stream factory that is used.void
Saves the model to the location where it originally came from.void
setOutputStreamFactory
(ILcdOutputStreamFactory aOutputStreamFactory) Sets the output stream factory to be used.
-
Field Details
-
DEFAULT_DISPLAY_NAME
- See Also:
-
-
Method Details
-
getOutputStreamFactory
Description copied from interface:ILcdOutputStreamFactoryCapable
Returns the output stream factory that is used.- Specified by:
getOutputStreamFactory
in interfaceILcdOutputStreamFactoryCapable
- Returns:
- the output stream factory that is used.
-
setOutputStreamFactory
Description copied from interface:ILcdOutputStreamFactoryCapable
Sets the output stream factory to be used.- Specified by:
setOutputStreamFactory
in interfaceILcdOutputStreamFactoryCapable
- Parameters:
aOutputStreamFactory
- the output stream factory to be used.
-
getDisplayName
Description copied from interface:ILcdModelEncoder
Returns a short, displayable name for the format thisILcdModelEncoder
encodes to.- Specified by:
getDisplayName
in interfaceILcdModelEncoder
- Returns:
- the displayable name of this
ILcdModelEncoder
.
-
canSave
Description copied from interface:ILcdModelEncoder
Returns whether this model encoder can save the specified model to the location it originally came from. Often this will only be a simple test, for example checking the type of the model's model descriptor.- Specified by:
canSave
in interfaceILcdModelEncoder
- Parameters:
aModel
- the model to be verified.- Returns:
true
if this encoder can save the model in the location where it originally came from,false
otherwise.- See Also:
-
canExport
Description copied from interface:ILcdModelEncoder
Returns whether this encoder can export the specified model to the specified destination. This method will typically check whether the contents of the specified model are compatible with the format this encoder is written for.- Specified by:
canExport
in interfaceILcdModelEncoder
- Parameters:
aModel
- the model to be verified.aDestinationName
- the location where the model should be exported to.- Returns:
true
if this encoder can export the specified model to the specified location,false
otherwise.- See Also:
-
save
Description copied from interface:ILcdModelEncoder
Saves the model to the location where it originally came from.- Specified by:
save
in interfaceILcdModelEncoder
- Parameters:
aModel
- the model to be saved.- Throws:
IllegalArgumentException
- if the model cannot be saved by this encoder (!canSave(aModel)
).IOException
- if an I/O error occurs during encoding.
-
export
public void export(ILcdModel aModel, String aDestinationName) throws IllegalArgumentException, IOException Description copied from interface:ILcdModelEncoder
Exports the specified model to the specified destination.- Specified by:
export
in interfaceILcdModelEncoder
- Parameters:
aModel
- the model to be exported.aDestinationName
- the location where the model should be saved. Typically, this is a name for the output file, but it can also point to a file containing the required properties to create a set of data files.- Throws:
IllegalArgumentException
- if the model cannot be saved by this encoder (!canExport(aModel, aDestinationName)
).IOException
- if an I/O error occurs during encoding.
-