[Gdal-dev] warping a raster with a matrix

Matt Wilkie matt.wilkie at gov.yk.ca
Thu Oct 25 14:15:27 EDT 2007


Hi List,

I'm looking for pointers on how to transform a raster with offsets in a 
text file (the matrix). The matrix could just easily be a point 
shapefile or another raster.

Format of the matrix: X Y   Xoffset Yoffset
Where X,Y is the current position of the pixel and X/Yoffset is where to 
move it, and adjacent pixels, to.


315200 5373600    -9.3     8.3
315300 5373600    -5.9     9.8
315400 5373600    -2.9    11.2
315500 5373600     0.2    12.6
315600 5373600     0.5    12.4
315700 5373600     0.6    12.2


There is pseudo code for doing this here:
http://www.cits.rncan.gc.ca/cit/servlet/CIT/site_id=01&page_id=1-005-002-010-002-001.html
but I'm unsure how to begin pythonising it. The example given there is 
for vectors.

thanks in advance for your thoughts,

-- 
matt wilkie
--------------------------------------------
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------




More information about the Gdal-dev mailing list