[gdal-dev] (1) NITF imagery in polar regions; (2) Memory question

Karney, Charles ckarney at Sarnoff.com
Tue Apr 7 11:46:42 EDT 2009


(1) The documentation for NITF data says that it typically uses a polar
projection north of 80N where

    x = (90-lat) * sin(lon)
    y = (90-lat) * -cos(lon)

(not sure I have the phase of lon right...).  I have an ONC image
00028053.on9 where the projection is in this form (lat = 80N is
circular).

However GDAL thinks there's merely an affine transformation between
image space and geographic coordinates.  So when I warp the image to
WGS84 geographic coordinates, lat = 80N is still curved.

Is this a problem with the meta data in my file?  Or is GDAL mishandling
these images at high latitudes.

(I can provide the image file, if necessary.)

(2) I'm having a problem figuring out from the documentation what the
precise rules are on allocating and freeing memory.  In some cases, it's
spelled out.  In others, I'm left to guess.  For example, after

  GDALWarpOptions *warpopt = NULL;
  warpopt = GDALCreateWarpOptions();
  warpopt->panSrcBands = (int *) CPLMalloc(sizeof(int) * totchan);

how does the memory allocated by CPLMalloc get freed.  When I do

  GDALDestroyWarpOptions( warpopt );

or do I have to free it explicitly?

Perhaps this is documented in some place I have stumbled on yet.  Or
perhaps, there's a convention in the prefix letters ("pan") that tells
me how it's handled.

Any guidance would be appreciated.  (I'm using the C++ interface.)

--
Charles Karney <ckarney at sarnoff.com>
Sarnoff Corporation, Princeton, NJ 08543-5300

Tel: +1 609 734 2312
Fax: +1 609 734 2662


More information about the gdal-dev mailing list