Bar,

I think you are setting the GCPs up wrongly if you want them to be at the corners.

GCP(LeftDown.X, LeftDown.Y, LeftDown.Z, Height - 0.5, null, "4") does not have 0 before Height-0.5.

GCPsToGeoTransform checks the special case of GCPs in rectangular shape and in top-left, top-right, bottom-right, bottom-left order and returns the exact transform the dataset has.

I'm not sure if it makes sense to have real values for the pixel coordinates although they are real values.

Best,

Ari

On 18.11.2015 09:32, Bar Ori wrote:

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:

vargcps = new[]

{

newGCP(LeftUp.X, LeftUp.Y, LeftUp.Z, 0.5, 0.5, null, "1"),

newGCP(RightUp.X, RightUp.Y, RightUp.Z, Width - 0.5, 0.5, null, "2"),

newGCP(RightDown.X, RightDown.Y, RightDown.Z, Width - 0.5, Height - 0.5, null, "3"),

newGCP(LeftDown.X, LeftDown.Y, LeftDown.Z, Height - 0.5, null, "4")

};

And when I am doing as follows:

vargeotransform = new double[6];

Gdal.GCPsToGeoTransform(gcps, geotransform, 0)

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

vargeotransform = 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.

**

****

        

*Ori Bar |***Software Developer

Applications Development

Elbit Systems Land and C4I

*T *+972-9-8898*900 **|****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.
*


_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to