Re: Need help with map projection conversion in ENVI [message #74520] |
Sun, 23 January 2011 19:22  |
BLesht
Messages: 89 Registered: March 2007
|
Member |
|
|
On Jan 23, 7:08 pm, Robin Wilson <ro...@rtwilson.com> wrote:
>> I've been going back and forth on this with no success. Any
>> suggestions would be most welcome.
>
> This could well be a bit of a long shot...but I noticed that the output
> filename was not defined properly in the code you gave. You had the code:
>
> oname=/temp.img'
>
> As far as I can see there may be two things wrong with that:
>
> 1) It needs a ' at the beginning to make it a valid string (although the
> compiler will probably catch that, so I guess that's a typo when copying
> to the newsgroup
>
> 2) A filename of "/temp.img" on a Linux/Unix/OS X machine may well not
> be able to be written to, as you are unlikely to have write access to
> the root of the root filesystem.
>
> ENVI_FILE_OPEN will give an rfid of -1 if it couldn't open the file, so
> if the file hadn't been written properly in the first place then that
> might explain why.
>
> It's just a crazy idea...but it can often be the simplest things that
> cause the major problems (I know I've done this before).
>
> Cheers,
>
> Robin
Thanks, Robin -- I wish it was that simple. The first ' got lost when
I did some editing. It is there in the code.
|
|
|
|
|
Re: Need help with map projection conversion in ENVI [message #74658 is a reply to message #74584] |
Tue, 25 January 2011 13:42  |
BLesht
Messages: 89 Registered: March 2007
|
Member |
|
|
On Jan 25, 6:46 am, Allard de Wit <allard.de...@wur.nl> wrote:
> Dear Barry,
>
> The approach to be used is first to georeference
> the image in its original projection (the Mercator
> projection) which indeed needs the tie point
> (image row/column number with given lat/lon) and
> the pixel size which is in decimal degrees for
> the Mercator projection. The latter means that
> although coordinates between the pixels step with
> equal degrees, the real pixel size (in m2)
> changes with latitude. Also you need to
> associate the Mercator project with your image.
>
> After having georeferenced the image you can
> check for correctness by overlaying the
> coastlines (see "create World boundaries").
> Converting to a geographic project should then be
> easy.
>
> I would have to look into it to see how this should
> be done from the ENVI API, but in general your
> approach seems OK. Anyway,I would first test
> it from within the ENVI interface.
>
> Allard
Thanks, Allard. I will try that (again). I appreciate your
suggestion. Barry
|
|
|