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

Home » Public Forums » archive » Re: Need help with map projection conversion in ENVI
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Need help with map projection conversion in ENVI [message #74520] Sun, 23 January 2011 19:22 Go to next message
BLesht is currently offline  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 #74521 is a reply to message #74520] Sun, 23 January 2011 17:08 Go to previous messageGo to next message
Robin Wilson is currently offline  Robin Wilson
Messages: 40
Registered: August 2010
Member
> 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
Re: Need help with map projection conversion in ENVI [message #74584 is a reply to message #74520] Tue, 25 January 2011 04:46 Go to previous messageGo to next message
wita is currently offline  wita
Messages: 43
Registered: January 2005
Member
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
Re: Need help with map projection conversion in ENVI [message #74658 is a reply to message #74584] Tue, 25 January 2011 13:42 Go to previous message
BLesht is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: listing all subroutines and paths used in a program.
Next Topic: How to speed up or remove this FOR loop

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

Current Time: Wed Oct 08 13:54:30 PDT 2025

Total time taken to generate the page: 0.00668 seconds