I am trying wrap my raster with GCP control points using gdal_translate and gdalwrap tools. I've read at gdal mailing list about wrap with affine transformation, so I thought it is easy to done using GCP control points and TPS transformation. I've Tif file with tfw file in WGS_84 coordinate system.
First I've create template vrt file using my orginal file like this:
gdal_translate orginal.tif temp.vrt -of VRT
Next, I've edited vrt file, where I added as a elements inside VRTDataset element code that is shown below:
<GCPList Projection="EPSG:4326"> <GCP Id="1" Pixcel="5650959.808031" Line="4432086.318384" X="4432215.141964" Y="5650933.901849" /> . . </GCPList>
where I wrote gcp with this scheme:
<GCP Id="unique number etc. 1, 2" Pixcel="x_source" Line="y_source" X="x_target" Y="y_target" />
EDIT: For x_source, y_source, x_target, y_target I use geographic coordination x, y value source or target
In next step I similarly as at linked post I've used gdal_translate again: gdal_translate temp.vrt out.tif
Finally, I try execute gdalwrap using:
gdalwarp src.tif out.tif -tps
but this process are aborted with error code:
ERROR 1: Unable to compute a GCP_TPS based transformation between pixel/line and georeferenced coordinates for out.tif
I want to wrap my image using control points, as a result which transform using gcp control points. What should I do to get wrap image with georeference?
Note: Moreover, If easy solution is algorithm I may can write C++ code