Search in sources :

Example 11 with TreEntryImpl

use of org.codice.imaging.nitf.core.tre.impl.TreEntryImpl in project alliance by codice.

the class ImageInputTransformerTest method createNitfWithPiatgb.

private static void createNitfWithPiatgb(File file) {
    NitfHeader header = NitfHeaderFactory.getDefault(FileType.NITF_TWO_ONE);
    Tre piatgb = TreFactory.getDefault("PIATGB", TreSource.ImageExtendedSubheaderData);
    piatgb.add(new TreEntryImpl("TGTUTM", "55HFA9359093610", "string"));
    piatgb.add(new TreEntryImpl("PIATGAID", "ABCDEFGHIJUVWXY", "string"));
    piatgb.add(new TreEntryImpl("PIACTRY", "AS", "string"));
    piatgb.add(new TreEntryImpl("PIACAT", "702XX", "string"));
    piatgb.add(new TreEntryImpl("TGTGEO", "351655S1490742E", "string"));
    piatgb.add(new TreEntryImpl("DATUM", "WGE", "string"));
    piatgb.add(new TreEntryImpl("TGTNAME", "Canberra Hill                         ", "string"));
    piatgb.add(new TreEntryImpl("PERCOVER", "57", "UINT"));
    piatgb.add(new TreEntryImpl("TGTLAT", "-35.30812 ", "float"));
    piatgb.add(new TreEntryImpl("TGTLON", "+149.12447 ", "float"));
    ImageSegment imageSegment = ImageSegmentFactory.getDefault(FileType.NITF_TWO_ONE);
    imageSegment.addImageBand(TreUtilityTest.createImageBand());
    imageSegment.getTREsRawStructure().add(piatgb);
    new NitfCreationFlowImpl().fileHeader(() -> header).imageSegment(() -> imageSegment).write(file.getAbsolutePath());
}
Also used : TreUtilityTest.createImageSegment(org.codice.alliance.transformer.nitf.TreUtilityTest.createImageSegment) ImageSegment(org.codice.imaging.nitf.core.image.ImageSegment) NitfCreationFlowImpl(org.codice.imaging.nitf.fluent.impl.NitfCreationFlowImpl) NitfHeader(org.codice.imaging.nitf.core.header.NitfHeader) Tre(org.codice.imaging.nitf.core.tre.Tre) TreEntryImpl(org.codice.imaging.nitf.core.tre.impl.TreEntryImpl)

Aggregations

Tre (org.codice.imaging.nitf.core.tre.Tre)11 TreEntryImpl (org.codice.imaging.nitf.core.tre.impl.TreEntryImpl)11 NitfCreationFlowImpl (org.codice.imaging.nitf.fluent.impl.NitfCreationFlowImpl)7 TreUtilityTest.createImageSegment (org.codice.alliance.transformer.nitf.TreUtilityTest.createImageSegment)6 ImageSegment (org.codice.imaging.nitf.core.image.ImageSegment)6 NitfHeader (org.codice.imaging.nitf.core.header.NitfHeader)4 HashMap (java.util.HashMap)3 NitfAttribute (org.codice.alliance.transformer.nitf.common.NitfAttribute)3 TreGroup (org.codice.imaging.nitf.core.tre.TreGroup)2 Test (org.junit.Test)2