Package com.luciad.format.kml22.xml
Class TLcdKML22ModelEncoder
java.lang.Object
com.luciad.format.kml22.xml.TLcdKML22ModelEncoder
- All Implemented Interfaces:
ILcdOutputStreamFactoryCapable
,ILcdModelEncoder
,Serializable
public final class TLcdKML22ModelEncoder
extends Object
implements ILcdModelEncoder, ILcdOutputStreamFactoryCapable
ILcdModelEncoder
implementation to convert a KML 2.2 model to a KML file.
The main purpose of this model encoder is to save KML models made programmatically, from a custom conversion process for example.
Limitations
- This model encoder doesn't export other models into KML files.
- This model encoder does not support kmz extension.
- This model encoder was not made for round-trips and KML models don't have a
reference
to this model encoder. - Relative network links will not be modified and this model encoder will not copy their target contents.
- Since:
- 2015.1
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether aILcdModel
can be exported to a KML file.boolean
Returns whether aILcdModel
can be saved.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.
-
Constructor Details
-
TLcdKML22ModelEncoder
public TLcdKML22ModelEncoder()Default constructor forTLcdKML22ModelEncoder
.
-
-
Method Details
-
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
Returns whether aILcdModel
can be saved.- Specified by:
canSave
in interfaceILcdModelEncoder
- Parameters:
aModel
- the model to be verified.- Returns:
- true if the model is a KML model.
- 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.
-
canExport
Returns whether aILcdModel
can be exported to a KML file.- 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 the model is a KML model and the destination is valid.
- See Also:
-
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.
-
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.
-
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.
-