[gdal-dev] GCPsToGeoTransform returns wrong values

Bar Ori Ori.Bar at elbitsystems.com
Tue Nov 17 23:32:06 PST 2015


Hi,
I noticed something that for me looks weird and I would like to know maybe I am doing something wrong.
If not, how should I overcome this behavior.

I set 4 GCPs as follows:

var gcps = new[]
{
new GCP(LeftUp.X, LeftUp.Y, LeftUp.Z, 0.5, 0.5, null, "1"),
new GCP(RightUp.X, RightUp.Y, RightUp.Z, Width - 0.5, 0.5, null, "2"),
new GCP(RightDown.X, RightDown.Y, RightDown.Z, Width - 0.5, Height - 0.5, null, "3"),
new GCP(LeftDown.X, LeftDown.Y, LeftDown.Z, Height - 0.5, null, "4")
};

And when I am doing as follows:

var geotransform = new double[6];
Gdal.GCPsToGeoTransform(gcps, geotransform, 0)

Or (after using dataSet.SetGCPs(gcps, projection) :

var geotransform = new double[6];
dataSet.GetGeoTransform(geotransform);

So the values returned, are wrong.
For example, if the LeftUp.X was 35.01050 so the value of geotransform[0], which supposed to be the same value, can be 35.0082.
The same with all the geotransform values.
If I am getting from the dataset and setting again, every time it is changing more and more.
Is there any connection to the use of the "0.5"?

Thanks.


[cid:image001.png at 01D121E3.FD25A2D0]

Ori Bar | Software Developer
Applications Development
Elbit Systems Land and C4I
T  +972-9-8898900  |   M  +972-504-734296




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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151118/986f316a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4160 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151118/986f316a/attachment-0001.png>


More information about the gdal-dev mailing list