Package com.luciad.format.sqlite.lrdb
Class TLcdLRDBModelEncoder
java.lang.Object
com.luciad.format.sqlite.lrdb.TLcdLRDBModelEncoder
- All Implemented Interfaces:
ILcdModelEncoder
,ILcdStatusSource
,Serializable
@LcdService(service=ILcdModelEncoder.class,
priority=20000)
public class TLcdLRDBModelEncoder
extends Object
implements ILcdModelEncoder, ILcdStatusSource
A model encoder that converts
ILcdRaster
s, ILcdMultiLevelRaster
s and
ILcdEarthTileSet
s to LRDB.
This format is intended for use only with existing Luciad applications and should not be used otherwise.
If you are looking for an SQLite-based exchange format, we advise to use OGC GeoPackage
instead.
- Since:
- 2013.1
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusListener
(ILcdStatusListener aStatusListener) Registers the given listener so it will receive status events from this source.boolean
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 the bounds of the area to encode.Returns the reference the current area to encode is defined in.float
Returns the current image compression quality setting.Returns a short, displayable name for the format thisILcdModelEncoder
encodes to.Returns the current image compression format.int
Returns the maximum tile level.Returns the reference rasters will be encoded in.void
removeStatusListener
(ILcdStatusListener aStatusListener) Removes the specified listener so it is no longer notified.void
Saves the model to the location where it originally came from.void
setAreaOfInterest
(ILcdBounds aAreaOfInterest, ILcdGeoReference aAreaOfInterestReference) Define the area of the raster to encode.void
setCompressionQuality
(float aCompressionQuality) Sets the image compression quality setting between 0.0 and 1.0.void
setImageCompressionFormat
(String aImageCompressionFormat) Sets the format to use when compressing imagery data.void
setMaximumTileLevel
(int aMaximumTileLevel) Sets the maximum tile level.void
setTargetReference
(ILcdGeoReference aTargetReference) Sets the target reference to encode the raster in.
-
Field Details
-
IMAGE_FORMAT_PNG
Constant for PNG image compression.- See Also:
-
IMAGE_FORMAT_JPEG
Constant for JPEG image compression.- See Also:
-
-
Constructor Details
-
TLcdLRDBModelEncoder
public TLcdLRDBModelEncoder()Creates a newTLcdLRDBModelEncoder
.
-
-
Method Details
-
getCompressionQuality
public float getCompressionQuality()Returns the current image compression quality setting.- Returns:
- the current compression quality setting.
- See Also:
-
setCompressionQuality
public void setCompressionQuality(float aCompressionQuality) Sets the image compression quality setting between 0.0 and 1.0. A value of 0.0 indicates high compression is preferred; a value of 1.0 indicates high image quality is preferred.- Parameters:
aCompressionQuality
- the new compression quality setting.- See Also:
-
getImageCompressionFormat
Returns the current image compression format.- Returns:
- the current image compression format
- See Also:
-
setImageCompressionFormat
Sets the format to use when compressing imagery data. The image compression format may be one of- image/jpeg
- image/png
- Parameters:
aImageCompressionFormat
- the new image compression format
-
addStatusListener
Description copied from interface:ILcdStatusSource
Registers the given listener so it will receive status events from this source.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this status source, you can use a
ALcdWeakStatusListener
instance as status listener.- Specified by:
addStatusListener
in interfaceILcdStatusSource
- Parameters:
aStatusListener
- The listener to be notified when the status has changed.
-
removeStatusListener
Description copied from interface:ILcdStatusSource
Removes the specified listener so it is no longer notified.- Specified by:
removeStatusListener
in interfaceILcdStatusSource
- Parameters:
aStatusListener
- The listener to remove.
-
getTargetReference
Returns the reference rasters will be encoded in.- Returns:
- the current target reference.
-
setTargetReference
Sets the target reference to encode the raster in. The newly created LRDB file will have this reference. Rasters that are defined in another reference will be automatically converted to the target reference before being encoded to LRDB. If no target reference is set, the original reference of the raster will be used as target reference.- Parameters:
aTargetReference
- The new target reference.
-
getAreaOfInterest
Returns the bounds of the area to encode.- Returns:
- the current area to encode.
- See Also:
-
getAreaOfInterestReference
Returns the reference the current area to encode is defined in.- Returns:
- the reference of the area to encode.
- See Also:
-
setAreaOfInterest
public void setAreaOfInterest(ILcdBounds aAreaOfInterest, ILcdGeoReference aAreaOfInterestReference) Define the area of the raster to encode. Only tiles that overlap with this area will be encoded. This means that some data outside the area will also be encoded but mostly only on the less detailed levels. Note that the bounds reference is not required to be identical to the reference used insetTargetReference(com.luciad.reference.ILcdGeoReference)
. Typical input for this method will the bounds of the model to encode, together with the geo reference of that model.- Parameters:
aAreaOfInterest
- the new area to encode.aAreaOfInterestReference
- The reference of the provided bounds.
-
getMaximumTileLevel
public int getMaximumTileLevel()Returns the maximum tile level.- Returns:
- the current maximum tile level.
-
setMaximumTileLevel
public void setMaximumTileLevel(int aMaximumTileLevel) Sets the maximum tile level. If a multilevel raster or tile set with a higher number of levels is encoded only up to aMaximumTileLevel of the least detailed levels will be encoded.- Parameters:
aMaximumTileLevel
- the new maximum tile level.
-
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:
aILcdModel
- 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:
-
save
Description copied from interface:ILcdModelEncoder
Saves the model to the location where it originally came from.- Specified by:
save
in interfaceILcdModelEncoder
- Parameters:
aILcdModel
- 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.
-
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
.
-
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.aDestination
- 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:
-
export
public void export(ILcdModel aModel, String aDestination) 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.aDestination
- 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.
-