[gdal-dev] GetGCPs returns null

Even Rouault even.rouault at spatialys.com
Mon Nov 16 09:56:49 PST 2015


Le lundi 16 novembre 2015 18:51:01, Bar Ori a écrit :
> I did some check now and yes...
> Idea is that for my tests, I used simple case of rectangle.
> Now, I changed a little the coordinates (not a rectangle) and received the
> points. Little weird but at least solved.
> Thank you very much.

Please keep the list CC'ed

> 
> So in this case, if the GCP count are 0, I can assume it is a rectangle and
> use the GeoTransform and if not, to extricate the GCPs. Am I right?

GetGeoTransform() will return CE_None if there's a geotransform or CE_Failure 
otherwise.
So you can call GetGeoTransform() and GetGCPs() in the order you wish.

> 
> -----Original Message-----
> From: Even Rouault [mailto:even.rouault at spatialys.com]
> Sent: 16 November 2015 19:19
> To: Bar Ori
> Cc: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] GetGCPs returns null
> 
> Le lundi 16 novembre 2015 16:24:40, Bar Ori a écrit :
> > I am using ICORDS="D", but I also tried ICORDS ="G". Didn't work.
> 
> If the corner coordinates are almost a rectangle (I know you mention they
> are not, but in the case they would be close to one, but not strictly
> one), it is possible that an approximate GeoTransform is computed from
> them. Otherwise you'll have to debug in the driver to figure what happens.
> First step would be to display debug messages with CPL_DEBUG=ON
> 
> > -----Original Message-----
> > From: Even Rouault [mailto:even.rouault at spatialys.com]
> > Sent: 16 November 2015 17:01
> > To: gdal-dev at lists.osgeo.org
> > Cc: Bar Ori
> > Subject: Re: [gdal-dev] GetGCPs returns null
> > 
> > Le lundi 16 novembre 2015 15:51:10, Bar Ori a écrit :
> > > Hi all,
> > > I wanted some explanations please about how to work with the GCPs.
> > > I have an image and I want to save its corners coordinates (not a
> > > rectangle) as GCPs and not using the SetGeoTransform method which
> > > takes the upper-left coordinate and creates a rectangle based on it. I
> > > accomplished it using the SetGCPs method. I even see that the IGEOLO
> > > field (I am working with NITF) is set correctly with those
> > > coordinates. The problem is that I want to retrieve those coordinates
> > > for painting a footprint on a map I have. I Tried the GetGCPs method
> > > but I got null. Also the GetGCPCount returns 0. (I can get the data
> > > from the IGEOLO, but I prefer another solution, and in general to
> > > understand why GetGCPs returns
> > > nothing...)
> > 
> > Could be related to a wrong value of the ICORDS creation option.
> > SetGCPs() and GetGCPS() are tested in
> > https://trac.osgeo.org/gdal/browser/trunk/autotest/gdrivers/nitf.py#L1967
> > 
> > Even
> > 
> > --
> > Spatialys - Geospatial professional services http://www.spatialys.com
> > 
> > The information in this e-mail transmission contains proprietary and
> > business sensitive information.  Unauthorized interception of this e-mail
> > may constitute a violation of law. If you are not the intended recipient,
> > you are hereby notified that any review, dissemination, distribution or
> > duplication of this communication is strictly prohibited. You are also
> > asked to contact the sender by reply email and immediately destroy all
> > copies of the original message.

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list