Opened 7 years ago

Closed 3 years ago

#5589 closed enhancement (wontfix)

Allow base64 encoding of CGM data when creating NITF files

Reported by: hikergreg Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords:


When creating NITF files with CGM data, the user provides the binary CGM data in a char* with minimal escaping (see SEGMENT_0_DATA field at

This works fine with the C/C++ interface, but an issue arises with the Java bindings. In Java, the binary data is put in a String object, but the Java native level interprets Strings as being UTF-encoded by default. This borks up the data transfer.

My suggestion is to add a flag that would allow for the CGM data to be provided using base64 encoding instead of the default backslash-quotable. For example: SEGMENT_0_DATA_ENCODING=base64.

I've attached a patch with a proposed implementation for NITF/CGM creation. I can come up with some edits to the documentation as well.

Attachments (1)

nitf_cgm.patch (1.6 KB) - added by hikergreg 7 years ago.
Proposed patch

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by hikergreg

Attachment: nitf_cgm.patch added

Proposed patch

comment:1 Changed 7 years ago by Even Rouault

Yes, an update of the doc would be appropriate

comment:2 Changed 7 years ago by Even Rouault

Still waiting for an update of the doc

comment:3 Changed 3 years ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to if it is not already reported there.

Note: See TracTickets for help on using tickets.