comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Map Projection Conversion in ENVI
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Map Projection Conversion in ENVI [message #66919] Wed, 17 June 2009 15:49
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

OK, I am at wit's end here.

I have opened a MISR image in ENVI. I've used blocks 10-35,
so this image is roughly over the Arctic Ocean. The
image is georeferenced to a Space Oblique Mercator
map projection. All well and good. The image runs
through (and extends outside) a rectangular grid I
am using for a study area.

I now wish to convert this image to a Lambert's Equal
Area projection, using a particular 500m grid that represents
my study area. (The original data is on a 275m grid.) I
can successfully use the Convert Map Projection selection
from under the Map menu to do this. I select the new
projection, give it the map coordinates (in my grid) of the (0,0)
pixel in the image (-1440000.0 and 2310537.95),
specify the output pixel sizes (500 m in both directions),
give it the dimensions of my output image (5760 by 4800),
and tell it to do a rigorous nearest neighbor regridding.
ENVI does its thing, and it works great. I'm happy.

But setting all this map conversion malarkey up is labor
intensive, and I would like to avoid it, since I have
a rather goodly number of images and I have no wish to
spend a week or so in this mindless and mind-numbing
behavior.

So I wrote an ENVI batch file (where I ran into the afore-
mentioned "array dimension zero" problem) and off ENVI
goes, but this time using Envi_Convert_File_Map_Projection.

mapStruct = Envi_Proj_Create(TYPE=36, NAME='fanningStudy', $
PARAMS=[6370997.0D, 90.0, 0.0, 0.0, 0.0])
Envi_Convert_File_Map_projection, DIMS=dims, R_FID=fID, $
O_PIXEL_SIZE=[500,500], OUT_BNAME=bnames, OUT_NAME=out_name, $
O_PROJ=mapStruct, RESAMPLING=0, WARP_METHOD=3, POS=[0,1,2,3]

It actually seems to warp the image correctly. Except that my
output is not 5760 x 4800. It is 7993 x 5668. And the
map coordinates of the (0,0) pixel are -2340960 and
2213641, not -1440000 and 2310538. It appears as though the
*entire* original image has been mapped to the new projection
but not clipped to my actual grid area as it was when
I did the conversion manually.

Does anyone know how I can confine the image to just that
part of the map projection I am interested in? Any image
pixels outside the region I am happy to throw away.

In other words, I need some way to tell my image that I am
only interested in pixels that start (in X) at -1440000
and that start in Y at 2310538 -(4800*500).

I see there is a Envi_Map_Info_Create routine that allows
me to actually use these numbers, but I don't see how to
use such a thing during the map conversion:

mapInfo = Envi_Map_Info_Create(PROJ=mapStruct, $
MC=[0d, 0d, -1440000.0d, 2310537.95d], $
PS=[5760,4800], NAME='fanningStudy')

Ideas certainly appreciated. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Previous Topic: usenet server.
Next Topic: Re: determining if a structure has a given tag

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:25:30 PDT 2025

Total time taken to generate the page: 0.01683 seconds