Reprojecting [message #38871] |
Thu, 08 April 2004 07:09  |
dsteinberg
Messages: 4 Registered: April 2004
|
Junior Member |
|
|
I am having trouble reprojecting images within IDL. I want to be able
to reproject the image arrays permanently, i.e. not just for display.
In other words, I would like to be able to read in EOS-HDF or GeoTIFF
files, reproject them into a desired projection and write them out as
new GeoTIFF's (in their new projection). So far I have run into a lot
of problems, and I am a bit stuck. If anyone has any leads (or
ideally .pro's) it would be greatly appreciated. Thanks.
-Dan
|
|
|
Re: Reprojecting [message #39052 is a reply to message #38871] |
Fri, 09 April 2004 11:32  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Thu, 08 Apr 2004 07:09:36 -0700, Dan Steinberg wrote:
> I am having trouble reprojecting images within IDL. I want to be able
> to reproject the image arrays permanently, i.e. not just for display.
> In other words, I would like to be able to read in EOS-HDF or GeoTIFF
> files, reproject them into a desired projection and write them out as
> new GeoTIFF's (in their new projection). So far I have run into a lot
> of problems, and I am a bit stuck. If anyone has any leads (or
> ideally .pro's) it would be greatly appreciated. Thanks.
As Ben mentioned last week, the MAP_PROJ_* routines let you access the
internal projection code (both forward and in reverse), and I've used
them successfully with INTERPOLATE to construct huge (~1Gpix) tiled
mappings directly with no display device:
...
map=map_proj_init('Aitoff',SPHERE_RADIUS=180.0D/!DPI, $
LIMIT=[quad_lat_min,quad_lon_min, $
quad_lat_max,quad_lon_max])
...
lonlat=map_proj_inverse(x,y,MAP_STRUCTURE=map)
x=reform((lonlat[0,*]-lonmin)/scale,width,height,/OVERWRITE)
y=reform((lonlat[1,*]-latmin)/scale,width,height,/OVERWRITE)
projected_result=interpolate(array,x,y,MISSING=!VALUES.F_NAN )
That particular SPHERE_RADIUS value is set to map x,y coordinates in
degrees of longitude and latitude (as my input images contain).
Otherwise x & y refer to physical coordinates on the surface of the
Earth (which might also be useful to you). See MAP_PROJ_INIT for
more.
JD
|
|
|