Use GCPs to reproject a ndarray

Shaunak De

Hello All, 

I have GCPs associated with a GeoTIFF as follows:

GroundControlPoint(row=0.0, col=0.0, x=14.674978814299008, y=69.61799429448102, z=-3.898888826370239e-05, id='1', info=''),
 GroundControlPoint(row=0.0, col=299.55555555555554, x=14.689285403048489, y=69.61991548229533, z=-3.908667713403702e-05, id='2', info=''),

and the CRS associated is "EPSG: 4326". I want to write a NumPy array with dimensions (12120, 2696) as a geotiff. I was trying to use rasterio.warp.reproject to accomplish this as follows:

warp.reproject(source=numpy_array_with_daya, gcps=gcps, src_crs=gcp_crs,'EPSG:4326'))

I run into this error:

AttributeError: 'NoneType' object has no attribute 'xoff'

I experimented a bit with the reproject function, but haven't been able to fully understand how to use it well. One of the things I tried was to specify "dst_transform" (computed from the calculate_default_transform function etc. and had a bit more luck producing an output at all, but I don't think I fully understand how this function works. Any help or pointers to documentation would be greatly appreciated.

Join to automatically receive all group messages.