[gdal-dev] GetProjectionRef() difference 1.8 vs 1.7.2

Even Rouault even.rouault at mines-paris.org
Mon Feb 14 14:38:03 EST 2011


Le lundi 14 février 2011 18:47:11, cobalto a écrit :
> Migrating from GDAL 1.7.2 to GDAL 1.8.0, I noticed that
> GDALDataset::GetProjectionRef() now returns an empty string "" on some
> cases where it previously returned an informative WKT string.
> The file I initially noticed this on was a 10Jan2009 Worldview image in
> NITF format. The image has 2 subdatasets, one of which (NITF_IM:1) is a
> 90x87 thumbnail, the other (NITF_IM:0) is an ~35k x 34k single band image.
> 
> In GDAL 1.7.2, GetProjectionRef Produced an identical string for both
> NITF_IM:0 and NITF_IM:1.
> In GDAL 1.8.0, GetProjectionRef Produces an empty string for NITF_IM:0 and
> the same string produced by 1.7.2 for NITF_IM:1.
> 
> Any ideas as to whether this is a design change or a bug? If design change,
> what is the new best practice to retreive the projection for NITF_IM:0?

Scott,

I don't recall a design change on this, but there were many changes in the 
driver between the 2 versions, so I might have missed something. What is sure 
is that GetProjectionRef() reports a projection from the information read in 
each image segment header, so it is not surprising that they can be different. 
Now I think only close inspection of the file can determine what happens and if 
it is a bug of 1.8.0 or if the driver of 1.7.2 didn't behave as expected. Or 
at the very least the output of gdalinfo NITF_IM:0:your.ntf and gdalinfo 
NITF_IM:1:your.ntf.

The output of the debug utility nitfdump (not built by default. On Linux/Unix 
go to gdal/frmts/nitf; make nitfdump) on the file could also help.

Best regards,

Even


More information about the gdal-dev mailing list