Re: ENVI Navigating GeoTiff Image Incorrectly? [message #78116] |
Thu, 27 October 2011 07:43  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Devin White writes:
> To get a better idea of what ENVI's actually doing, I'd use
> ENVI_CONVERT_FILE_COORDINATES instead of relying on what you see in
> the Pixel Locator or Cursor Location/Value tools. File coordinates
> should be supplied to that procedure as zero-based numbers, so you'll
> be able to do a direct comparison to your approach.
OK, I tried this approach this morning, and for this
UTM projection, the ENVI numbers are just totally
screwy. I'll see if I can put a sample image together
that demonstrates the problem.
I presume this is one reason ENVI moved to the ESRI
map projection code in what? ENVI 4.7?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: ENVI Navigating GeoTiff Image Incorrectly? [message #78122 is a reply to message #78116] |
Thu, 27 October 2011 02:44   |
devin.white
Messages: 50 Registered: March 2007
|
Member |
|
|
To get a better idea of what ENVI's actually doing, I'd use
ENVI_CONVERT_FILE_COORDINATES instead of relying on what you see in
the Pixel Locator or Cursor Location/Value tools. File coordinates
should be supplied to that procedure as zero-based numbers, so you'll
be able to do a direct comparison to your approach.
On Oct 26, 5:33 pm, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>> I don't have ANY idea how to explain this descrepancy,
>> except to say I *know* my values are correct and I know
>> the values I am getting from ENVI are wrong. I conclude
>> that ENVI is navigating this GeoTiff image incorrectly
>> which is causing me a great deal of distress when I try
>> to match these ENVI values! :-)
>
> By the way, this is ENVI 4.5 we are using to check these
> values and IDL 7.1.2.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: ENVI Navigating GeoTiff Image Incorrectly? [message #78200 is a reply to message #78116] |
Fri, 28 October 2011 07:20  |
guillermo.castilla.ca
Messages: 27 Registered: September 2008
|
Junior Member |
|
|
Hi David,
I think the problem could be that your tiff image does not use the
upper left corner of the tie point pixel as the reference. To make
sure that pixel coordinates refer to the center of the pixel as in the
ENVI convention, I do the following (assuming there is no rotation):
ok = QUERY_TIFF(myTiff, imginfo, GEOTIFF= mapinfo)
psz=mapinfo.ModelPixelSCALETAG[0] ; pixel size
x0= mapinfo.ModelTiePointTag[3] - mapinfo.ModelTiePointTag[0]*psz
y0= mapinfo.ModelTiePointTag[4] + mapinfo.ModelTiePointTag[1]*psz
ModelTiePointTag[0:1] indicate whether the coordinates of the tie
point refer to:
(1)the upper left corner of the pixel
(and in this case ModelTiePointTag[0:1]=[0,0]);
(2) the center of the pixel (ModelTiePointTag[0:1]=[0.5,0.5]); or
(3) the lower left corner of the pixel
(ModelTiePointTag[0:1]=[0,0.5])
See if your ModelTiePointTag[0:1]=[0,0]. If not, you were wrongly
assuming that the geotiff coordinates referred to the upper left
corner of the tie point pixel. This might not be necessarily be the
case.
Cheers
Guillermo
|
|
|