Package org.apache.sis.storage.geotiff
Class ImageMetadataBuilder
java.lang.Object
org.apache.sis.internal.storage.MetadataBuilder
org.apache.sis.storage.geotiff.ImageMetadataBuilder
A temporary object for building the metadata for a single GeoTIFF image.
Fields in the class are used only for information purposes; they do not
have incidence on the way Apache SIS will handle the GeoTIFF image.
Note:
if those fields become useful to
ImageFileDirectory
in a future version,
we can move them into that class. Otherwise keeping those fields here allow to
discard them (which save a little bit of space) when no longer needed.- Since:
- 1.2
- Version:
- 1.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.storage.MetadataBuilder
MetadataBuilder.GridType, MetadataBuilder.PartyType, MetadataBuilder.Scope
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate short
The size of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file.private short
The size of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file.private XMLMetadata
Metadata specified inGEO_METADATA
orGDAL_METADATA
tags, ornull
if none.private double
The number of pixels perresolutionUnit
in the image width and Height directions, orDouble.NaN
is unspecified.private javax.measure.Unit
<javax.measure.quantity.Length> The unit of measurement for the resolution value, ornull
if none. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addXML
(XMLMetadata xml) Adds metadata in XML format.(package private) void
finish
(ImageFileDirectory image, StoreListeners listeners) Completes the metadata with the information stored in the fields of the IFD.(package private) void
setCellSize
(short size, boolean w) Sets the width or height of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file.(package private) void
setResolution
(double r) Sets the resolution to the maximal of current value and given value.(package private) Integer
setResolutionUnit
(int unit) Sets the unit of measurement forXResolution
andYResolution
.(package private) Integer
setThreshholding
(int value) Encodes the value of Threshholding TIFF tag into thecellWidth
andcellHeight
fields.Methods inherited from class org.apache.sis.internal.storage.MetadataBuilder
addAbstract, addAccessConstraint, addAcquisitionOperation, addAcquisitionRequirement, addAcquisitionTime, addAcquisitionTime, addAuthor, addBandDescription, addBandName, addBoundingPolygon, addCitationDate, addCitedResponsibleParty, addCompleteMetadata, addCompression, addContentType, addControlPoints, addCredits, addDefaultMetadata, addDefaultMetadata, addDefaultMetadata, addDistributor, addEdition, addEncoding, addExtent, addExtent, addExtent, addFeatureType, addFeatureType, addFormatName, addFromComponent, addGeolocation, addHostComputer, addIdentifier, addIdentifier, addInstrument, addKeywords, addLanguage, addLineage, addMaximumSampleValue, addMinimumSampleValue, addNewBand, addOtherCitationDetails, addPage, addPage, addPlatform, addPointOfContact, addProcessDescription, addProcessing, addPurpose, addReferenceSystem, addResolution, addResourceScope, addSampleValueDescription, addSeries, addSoftwareReference, addSource, addSource, addSource, addSpatialRepresentation, addSpatialRepresentation, addSupplementalInformation, addTemporalExtent, addTitle, addTitleOrIdentifier, addTopicCategory, addUseLimitation, addVerticalExtent, build, buildAndFreeze, hasSampleValueRange, mergeMetadata, newAcquisition, newCoverage, newDistribution, newFeatureTypes, newGridRepresentation, newIdentification, newLineage, newParty, newSampleDimension, parseLegalNotice, setAxisName, setAxisResolution, setAxisSize, setBandIdentifier, setBandIdentifier, setBitPerSample, setCellGeometry, setCloudCoverPercentage, setFormatEdition, setGeoreferencingAvailability, setGridToCRS, setIlluminationAzimuthAngle, setIlluminationElevationAngle, setISOStandards, setPointInPixel, setPredefinedFormat, setProcessingLevelCode, setSampleUnits, setTransferFunction, shared, shared
-
Field Details
-
resolution
private double resolutionThe number of pixels perresolutionUnit
in the image width and Height directions, orDouble.NaN
is unspecified. Since ISO 19115 does not have separated resolution fields for image width and height, Apache SIS stores only the maximal value. -
resolutionUnit
private javax.measure.Unit<javax.measure.quantity.Length> resolutionUnitThe unit of measurement for the resolution value, ornull
if none. A null value is used for images that may have a non-square aspect ratio, but no meaningful absolute dimensions. Default value for TIFF files is inch. -
cellWidth
private short cellWidthThe size of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file. This field should be present only ifThreshholding
tag is 2 (an ordered dither or halftone technique has been applied to the image data). Special values:- -1 means that
Threshholding
is 1 or unspecified. - -2 means that
Threshholding
is 2 but the matrix size has not yet been specified. - -3 means that
Threshholding
is 3 (randomized process such as error diffusion).
- -1 means that
-
cellHeight
private short cellHeightThe size of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file. This field should be present only ifThreshholding
tag is 2 (an ordered dither or halftone technique has been applied to the image data). Special values:- -1 means that
Threshholding
is 1 or unspecified. - -2 means that
Threshholding
is 2 but the matrix size has not yet been specified. - -3 means that
Threshholding
is 3 (randomized process such as error diffusion).
- -1 means that
-
complement
Metadata specified inGEO_METADATA
orGDAL_METADATA
tags, ornull
if none.
-
-
Constructor Details
-
ImageMetadataBuilder
ImageMetadataBuilder()Creates an initially empty metadata builder.
-
-
Method Details
-
setThreshholding
Encodes the value of Threshholding TIFF tag into thecellWidth
andcellHeight
fields. Recognized values are:- 1 = No dithering or halftoning has been applied to the image data.
- 2 = An ordered dither or halftone technique has been applied to the image data.
- 3 = A randomized process such as error diffusion has been applied to the image data.
- Parameters:
value
- the threshholding value.- Returns:
null
on success, or the given value if not recognized.
-
setCellSize
void setCellSize(short size, boolean w) Sets the width or height of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file. Meaningful only if Threshholding = 2.- Parameters:
size
- the new size.w
-true
for setting cell width, orfalse
for setting cell height.
-
setResolution
void setResolution(double r) Sets the resolution to the maximal of current value and given value. -
setResolutionUnit
Sets the unit of measurement forXResolution
andYResolution
. Recognized values are:- 1 = None. Used for images that may have a non-square aspect ratio.
- 2 = Inch (default).
- 3 = Centimeter.
- Parameters:
value
- the threshholding value.- Returns:
null
on success, or the given value if not recognized.
-
addXML
Adds metadata in XML format. Those metadata are defined inGEO_METADATA
orGDAL_METADATA
tags. -
finish
Completes the metadata with the information stored in the fields of the IFD. This method is invoked only if the user requested the ISO 19115 metadata. It should be invoked last, after all other metadata have been set.- Throws:
DataStoreException
- if an error occurred while reading metadata from the data store.
-