[Gdal-dev] Can GDAL GDALDataset return compressed image data

Alison Luo alison_luo2001 at yahoo.com
Mon Jun 11 15:53:55 EDT 2007


Hi Frank,

I still can not get the correct compressed data stream
using NITFSegmentInfo. I add the offset nSegmentStart
to the pointer hAccess, which should bring me to the
beginning of the compressed data stream. Then I read
nSegmentSize bytes of data from there. But from what I
read in memory, the returned block of data is not
correct. I expect to see the exact jpeg compressed
data returned.

I don't know what's wrong with my workflow. I'm
attaching the sample file I've been using.

By the way, is there any free NITF file viewer for
Windows platform to download?

Thanks,
Alison

--- Frank Warmerdam <warmerdam at pobox.com> wrote:

> Alison Luo wrote:
> > Hi Ivan,
> > 
> > Thank you so much for your help. I have more
> questions
> > regarding the block of code you referred to in
> > nitifdataset.cpp. I also took a look of class
> > NITFSegmentInfo in nitflilb.h:
> > 
> > NITFSegmentInfo has a member hAccess, which is the
> > NITF image stream.
> 
> Alison,
> 
> It is a pointer to the NITFImage structure for image
> segemnts.
> 
>  >  I suppose other pasSegmentInfo
> > member     
> >     GUInt32 nSegmentHeaderStart;
> >     GUInt32 nSegmentHeaderSize;
> >     GUInt32 nSegmentStart;
> >     GUInt32 nSegmentSize;
> > would somehow indicate how to get the encoded jpeg
> > stream from hAccess? Could you please explain how
> the
> > jpeg buffer is filled given this information?
> 
> They are information on where the image header, and
> image
> data chunks are in the file.  So compressed data
> stream
> would consist of nSegmentSize bytes started at byte
> nSegmentStart
> in the file.
> 
> > Why doesn't GDAL provide APIs to access encoded
> image
> > stream, but only provide API to get raw image
> stream?
> 
> GDAL does not provide direct access to compressed
> datastreams
> because the purpose of GDAL is to provide a
> "normalized" view to
> different datasets, not to provide low level access.
> 
> Best regards,
> -- 
>
---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank
> Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows |
> http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President
> OSGeo, http://osgeo.org
> 
> 



      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: i_3008a.ntf
Type: application/octet-stream
Size: 21212 bytes
Desc: 2095884774-i_3008a.ntf
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070611/b4717b36/i_3008a.obj


More information about the Gdal-dev mailing list