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 shortThe size of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file.private shortThe size of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file.private XMLMetadataMetadata specified inGEO_METADATAorGDAL_METADATAtags, ornullif none.private doubleThe number of pixels perresolutionUnitin the image width and Height directions, orDouble.NaNis unspecified.private javax.measure.Unit<javax.measure.quantity.Length>The unit of measurement for the resolution value, ornullif none. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddXML(XMLMetadata xml) Adds metadata in XML format.(package private) voidfinish(ImageFileDirectory image, StoreListeners listeners) Completes the metadata with the information stored in the fields of the IFD.(package private) voidsetCellSize(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) voidsetResolution(double r) Sets the resolution to the maximal of current value and given value.(package private) IntegersetResolutionUnit(int unit) Sets the unit of measurement forXResolutionandYResolution.(package private) IntegersetThreshholding(int value) Encodes the value of Threshholding TIFF tag into thecellWidthandcellHeightfields.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 perresolutionUnitin the image width and Height directions, orDouble.NaNis 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, ornullif 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 ifThreshholdingtag is 2 (an ordered dither or halftone technique has been applied to the image data). Special values:- -1 means that
Threshholdingis 1 or unspecified. - -2 means that
Threshholdingis 2 but the matrix size has not yet been specified. - -3 means that
Threshholdingis 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 ifThreshholdingtag is 2 (an ordered dither or halftone technique has been applied to the image data). Special values:- -1 means that
Threshholdingis 1 or unspecified. - -2 means that
Threshholdingis 2 but the matrix size has not yet been specified. - -3 means that
Threshholdingis 3 (randomized process such as error diffusion).
- -1 means that
-
complement
Metadata specified inGEO_METADATAorGDAL_METADATAtags, ornullif none.
-
-
Constructor Details
-
ImageMetadataBuilder
ImageMetadataBuilder()Creates an initially empty metadata builder.
-
-
Method Details
-
setThreshholding
Encodes the value of Threshholding TIFF tag into thecellWidthandcellHeightfields. 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:
nullon 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-truefor setting cell width, orfalsefor 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 forXResolutionandYResolution. 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:
nullon success, or the given value if not recognized.
-
addXML
Adds metadata in XML format. Those metadata are defined inGEO_METADATAorGDAL_METADATAtags. -
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.
-