Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 2.1 KB

README.md

File metadata and controls

65 lines (52 loc) · 2.1 KB

imaging-nitf

Build Status CLA assistant

Pure Java National Imagery Transmission Format (NITF) file support.

This implementation provides parsing for NITF 2.0 and NITF 2.1 files. NATO Secondary Imagery Format 1.0 (NSIF 1.0) is effectively NITF 2.1 and is also supported.

Building

git clone git://github.com/codice/imaging-nitf.git

Change to the root directory of the cloned repository. Run the following command:

mvn install

This will compile imaging-nitf and run all of the tests.

Maven

  <dependency>
    <groupId>org.codice.imaging.nitf</groupId>
    <artifactId>codice-imaging-nitf-core</artifactId>
    <version>0.9-SNAPSHOT</version>
  </dependency>
  
  <dependency>
    <groupId>org.codice.imaging.nitf</groupId>
    <artifactId>codice-imaging-cgm</artifactId>
    <version>0.9-SNAPSHOT</version>
  </dependency>

Using

    File resourceFile = new File("sample.ntf");
    AllDataExtractionParseStrategy parseStrategy = new AllDataExtractionParseStrategy();
    NitfReader reader = new FileReader(resourceFile);
    NitfFileParser.parse(reader, parseStrategy);
    NitfFileHeader nitfFileHeader = parseStrategy.getNitfHeader();

Using the Flow API

    File resourceFile = new File("sample.ntf");
    new NitfParserInputFlow()
          .file(resourceFile)
          .allData()
          .fileHeader((header) -> handleFileHeader(header))
          .forEachImageSegment((imageSegment) -> handleImageSegment(imageSegment))
          .forEachDataSegment((dataSegment) -> handleDataSegment(dataSegment))
          .forEachSymbolSegment((symbolSegment) -> handleSymbolSegment(symbolSegment))
          .forEachGraphicSegment((graphicSegment) -> handleGraphicSegment(graphicSegment))
          .forEachTextSegment((textSegment) -> handleTextSegment(textSegment))
          .forEachLabelSegment((labelSegment) -> handleLabelSegment(labelSegment));