[gdal-dev] best way to compare in a numpy table the values of two images with different projection

Frank Warmerdam warmerdam at pobox.com
Wed May 12 10:53:50 EDT 2010

Matthieu Rigal wrote:
> Hi folks,
> I am currently implementing a tool to allow band-to-band computations on
> array values out of 2 images with different projection and different 
> resolution in python.
> The operation is quite complex, so I will summarize it here and below give 
> the solution I am currently testing to see if it is the best one and ask 
> for some enhancements and performance hints. Unfortunately, the high-level 
> warping class is, at my knowledge, only available in C++.
> Workflow (could also be improved by all-in-one functions like for C++)
> - Open image A, 5000*5000 pixels, 5m resolution, UTM
> - Open image B, approx 100m resolution, LatLon, much larger than the 
> previous one
> - Cut out the buffered extents of image A from image B
> - Reproject this cutted image to the projection and resolution of image A
> - Read full image A as array
> - Read extents of image A from image B as array


I think you might be able to short circuit some of the complexity by
creating a new memory dataset in UTM 5m with the same extents as
image A, and then just call ReprojectImage() to reproject from B to A.

Then this new memory dataset would be at the same resolution as A and
ready to compare, etc.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the gdal-dev mailing list